Skip to content
This repository has been archived by the owner on Jul 31, 2020. It is now read-only.

Commit

Permalink
Merge pull request #279 from brave/master_update
Browse files Browse the repository at this point in the history
Master update
  • Loading branch information
SergeyZhukovsky authored Feb 3, 2019
2 parents 56a0fe1 + 69de0db commit aa8e786
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 7 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ npm run start
## Testing

The sync client uses Browserify to transform Node js into browser js. To unittest
the library in a browser (default: electron), run `npm browsertest`.
To test in a different browser run `npm browsertest -- --browser chrome`.
the library in a browser (default: electron), run `npm run browsertest`.
To test in a different browser run `npm run browsertest -- --browser chrome`.
Results appear in both the browser inspector and your terminal.

To run tests in Node, just do `npm test`.
Expand Down
4 changes: 1 addition & 3 deletions client/requestUtil.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ const RequestUtil = function (opts = {}) {
this.serializer = opts.serializer
this.serverUrl = opts.serverUrl
this.userId = Buffer.from(opts.keys.publicKey).toString('base64')
// For SQS notifications filter, we should keep /
this.userIdEncoded = encodeURIComponent(this.userId).replace('%2F', '/')
// For SQS names, which don't allow + and /
this.userIdBase62 = this.userId.replace(/[^A-Za-z0-9]/g, '')
this.encrypt = cryptoUtil.Encrypt(this.serializer, opts.keys.secretboxKey, CONFIG.nonceCounter)
Expand Down Expand Up @@ -203,7 +201,7 @@ RequestUtil.prototype.list = function (category, startAt, maxRecords, nextContin
}

return s3Helper.listNotifications(this.sqs, notificationParams, category,
`${this.apiVersion}/${this.userIdEncoded}/${category}`)
prefix)
})
}

Expand Down
4 changes: 2 additions & 2 deletions lib/s3Helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,13 +158,13 @@ function listNotificationsRecursively (SQS, options, category, prefix, currentCo
if (bodyObject && bodyObject.Records && bodyObject.Records[0] &&
bodyObject.Records[0].s3 && bodyObject.Records[0].s3.object &&
bodyObject.Records[0].s3.object.key) {
key = bodyObject.Records[0].s3.object.key
key = decodeURIComponent(bodyObject.Records[0].s3.object.key)
}
}
// Poll only bookmark messages for now and delete notifications with other records
if (key.indexOf(prefix) === 0) {
let contentMessage = {
Key: `${decodeURIComponent(key)}`
Key: key
}
currentContent.push(contentMessage)
}
Expand Down

0 comments on commit aa8e786

Please sign in to comment.