-
Notifications
You must be signed in to change notification settings - Fork 135
Conversation
Localization authors: - Cristian Silaghi <[email protected]>
Localization authors: - Cristian Silaghi <[email protected]>
Localization authors: - Hyeonseok Shin <[email protected]>
Localization authors: - Hyeonseok Shin <[email protected]>
Localization authors: - Amanpreet Alam <[email protected]>
Localization authors: - mansimarkaur.mks <[email protected]> - Amanpreet Alam <[email protected]>
awwww yessss |
src/background.js
Outdated
@@ -12,7 +12,7 @@ const timeouts = {}; | |||
|
|||
// Kinto sync and encryption | |||
|
|||
const client = new KintoClient(KINTO_SERVER); | |||
const client = new Kinto({remote: KINTO_SERVER, bucket: "default"}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the bucket name be configurable?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I think we need to convert from double quotes to single quotes and declare Kinto as a global to appease the ESLint gods:
/home/travis/build/mozilla/notes/src/background.js
15:20 error 'Kinto' is not defined no-undef
15:57 error Strings must use singlequote quotes
UPDATE: You can fix the undefined Kinto global variable by adding it to ./eslintrc.yml (possibly replacing the KintoClient
entry):
Lines 9 to 14 in dca2e9c
globals: | |
KintoClient: false | |
Quill: false | |
Jose: false | |
JoseJWE: false | |
TestPilotGA: false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the bucket should be configurable. The default bucket is "API sugar" to allow each user to get their own bucket while still referring to them in a uniform way. It's the only one which behaves like this.
this.key = key; | ||
} | ||
|
||
async encode(record) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think ESLint is choking here and failing to parse the entire file... Should this be async function encode(record) {
?
/home/travis/build/mozilla/notes/src/sync.js
63:9 error Parsing error: Unexpected token encode
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, is it maybe the case that you guys stick to ES2015 on this project? Or which standard do you support? Per http://kangax.github.io/compat-table/es2016plus/#test-async_functions_async_methods,_classes, this syntax is supported in FF 52 ESR and greater, which is why it's used in the storage.sync implementation, which is why I copied and pasted it here 😊
return encryptedResult; | ||
} | ||
|
||
async decode(record) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same here.. should this be async decode(record) {}
or async function decode(record) {}
?
src/sync.js
Outdated
const notesIdSchema = { | ||
// FIXME: Maybe this should generate IDs? | ||
generate() { | ||
throw new Error("cannot generate IDs"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once the encode
/decode
issues are resolved below, I believe ESLint will start complaining about use of double quotes instead of single quotes here. Sorry.
src/sync.js
Outdated
// headers (If-Match, If-None-Match) correctly. | ||
// DON'T copy over "deleted" status, because then we'd leak | ||
// plaintext deletes. | ||
const status = record._status && (record._status == "deleted" ? "updated" : record._status); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: should use ===
instead.
src/sync.js
Outdated
return syncResult; | ||
}) | ||
.catch(error => { | ||
if (error.response && error.response.status == 401) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: use ===
here.
Seems to be working for a new account!!!! |
@Natim Seems to working well, i think the biggest thing we need is handling merge conflicts. There is some minor stuff such as the last sync time not updating: I synced at :44 on the hour, but still said :41: But that's small fish |
@Natim seems like after I close 2 profiles that I tested sync on and opened a 3rd profile I didn't get my notes back (got invalid date): |
Menu implementation for fixing #208. This commit adds the material-design-lite component library used for creating the menu and it's menu items.
Localization authors: - Théo Chevalier <[email protected]>
Localization authors: - Rok Žerdin <[email protected]>
Localization authors: - Kohei Yoshino <[email protected]>
Localization authors: - Michael Wolf <[email protected]>
Localization authors: - Juan Esteban Ajsivinac Sián <[email protected]>
Localization authors: - Juraj Cigáň <[email protected]>
Localization authors: - Michael Köhler <[email protected]>
Localization authors: - Michael Wolf <[email protected]>
Localization authors: - Balázs Meskó <[email protected]>
Localization authors: - Selim Şumlu <[email protected]>
Localization authors: - manxmensch <[email protected]>
First alpha version of the branch: addon-2.0.0a1.zip |
New version with QuillJS 1.3.3 addon-2.0.0a2.zip |
src/sync.js
Outdated
@@ -91,6 +91,9 @@ class JWETransformer { | |||
throw new Error('No ciphertext: nothing to decrypt?'); | |||
} | |||
|
|||
// FIXME: this is hack to work around a bug with FxA keys, which | |||
// seem to have timestamps embedded in them that are affected by | |||
// TZ offsets. Take out the substr calls once vladikoff says we can. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Revert "Use mocha spec reporter.", moving from the karma spec reporter back to the karma mocha reporter, just because it seems better supported and is part of the example-webextension standard we're trying to follow. Try to achieve the same effect using the built-in Karma option reportSlowerThan -- set it to a generous 40ms. This reverts commit 54299d2.
@@ -6,7 +6,7 @@ const TRACKING_ID = 'UA-35433268-79'; | |||
const KINTO_SERVER = 'https://kinto.dev.mozaws.net/v1'; | |||
// XXX: Read this from Kinto fxa-params | |||
const FXA_CLIENT_ID = 'c6d74070a481bc10'; | |||
const FXA_OAUTH_SERVER = 'https://oauth-scoped-keys.dev.lcip.org/v1'; | |||
const FXA_OAUTH_SERVER = 'https://oauth-scoped-keys-oct10.dev.lcip.org/v1'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This has the fixes to the kid
and other stuff
Since this PR is against sync-v4, I am going to land it and then we can keep improving sync-v4 branch until it is ready. |
By popular request, an attempt to introduce kinto.js offline-first syncing to try to simplify conflict handling. This just uses the bog standard IndexedDB "storage adapter", which works fine in web extensions, and happens to have a cleaner implementation than browser.storage.local anyhow.
This PR is a bit of a mess since I just plopped a bunch of code into place, but some additional information is in the commit messages. I tried to at least mark the dangerous places with FIXMEs.