Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If any Salesforce Reference commands are run while startup caching is running, duplicates are added to cache #16

Closed
Oblongmana opened this issue Sep 15, 2015 · 0 comments
Labels
Milestone

Comments

@Oblongmana
Copy link
Owner

If any Salesforce Reference commands are run while startup caching is running, duplicates are added to cache. Effectively - retrieves are not idempotent. This isn't generally a problem as we check to see if the particular doc type has already had entries cached, and don't fire off another retrieve if they are. However, when two retrieves are running simultaneously while none have yet begun adding entries to the cache, we wind up with duplicate entries due to the lack of uniqueness checks on insert

Repro:

  • Open Sublime
  • Immediately execute the "Salesforce Reference - Apex" command
  • Wait for Quick Panel to pop up
  • Observe that entries are duplicated

Solution:

  • Probably need to make the cache check for uniqueness?
  • Could maybe make the cache inherit from MutableSet and implement the necessary methods?
@Oblongmana Oblongmana added the bug label Sep 15, 2015
@Oblongmana Oblongmana added this to the 2.0.0 milestone Sep 15, 2015
Oblongmana added a commit that referenced this issue Sep 17, 2015
Fixes Issue #16

If a user fired off a retrieve from the command palette during Sublime
startup caching (for a doc type that was being cached), you would wind
up with duplicates.

To fix this, the cache now implements MutableSet as well as
MutableSequence, and existing methods check for existence of duplicates.
The whole structure could use some optimisation, but will get us over
the line for now
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant