Skip to content
This repository has been archived by the owner on Dec 11, 2019. It is now read-only.

Show bookmarks toolbar when bookmarks are synced for the first time #7300

Merged
merged 1 commit into from
Feb 21, 2017

Conversation

diracdeltas
Copy link
Member

@diracdeltas diracdeltas commented Feb 17, 2017

Fix #7282

Auditors: @ayumi

Test Plan:

  1. automated syncing bookmarks tests should pass
  2. open pyramid 0, enable sync
  3. open pyramid 1, sync it with pyramid 0
  4. add bookmarks to pyramid 0
  5. toolbar should appear in pyramid 1 once bookmarks are synced
  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Ran git rebase -i to squash commits (if needed).

app/sync.js Outdated
let showBookmarksToolbar = false
if (!initialState.seed) {
// syncing for the first time
const bookmarks = (AppStore.getState().get('sites') || new Immutable.List()).filter((site) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think siteUtil.getBookmarks() does this

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

app/sync.js Outdated
ipcMain.on(messages.SYNC_READY, module.exports.onSyncReady.bind(null,
isFirstRun))
initialized ? false : !initialState.seed && !initialState.deviceId))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

previously we extracted this out for clarity – is moving it into the function call needed?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ayumi yes, the previous code was incorrect because initialized gets changed later

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually this still seems incorrect (assuming bind argument expressions are not re-evaluated)

app/sync.js Outdated
syncUtil.applySyncRecords(records)
let showBookmarksToolbar = false
if (!initialState.seed) {
// syncing for the first time
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

on the first sync, i feel like we should just check records for any bookmarks and enable the toolbar here

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i didn't do that because the bookmarks toolbar could show up noticeably earlier than when any bookmarks are actually created (for instance when syncing a large set of records). but it does make the code simpler.

app/sync.js Outdated
showBookmarksToolbar = true
}
}
syncUtil.applySyncRecords(records, showBookmarksToolbar)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it seems unnecessary to pass showBookmarksToolbar here and 8 more times in syncUtil.js

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do you mean unnecessary with #7300 (comment) or something else?

@diracdeltas
Copy link
Member Author

@ayumi addressed review comments

Fix #7282

Auditors: @ayumi

Test Plan:
1. automated syncing bookmarks tests should pass
2. open pyramid 0, enable sync
3. open pyramid 1, sync it with pyramid 0
4. add bookmarks to pyramid 0
5. toolbar should appear in pyramid 1 once bookmarks are synced
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants