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

operationsClient's removeCompletedOperations doesn't work #14

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rcjsuen
Copy link
Contributor

@rcjsuen rcjsuen commented May 2, 2017

operationsClient's removeCompletedOperations doesn't actually remove the completed operations when the call is made to the preferences service. This is because it checks for a clear defined on the options to determine whether the original preference's value should be merged with the passed in value or not.

In our case, the operations list gets parsed and completed entries gets removed. Then it gets to the preferences service and the removed entries gets added back in because it believes that only the passed in values should be modified and any values that aren't passed in should just be preserved. This makes sense when thinking of preferences in the regular way but fails in the removeCompletedOperations case so the fix is to send in { clear: true } as an option when trying to remove the completed operations.

Note that this pull request is technically incomplete as the test doesn't seem to fail. When I comment out the fix, the test will just timeout instead of failing. The error that the assertion throws seems to get swallowed somewhere. Can someone with some knowledge about our Deferred implementation take a look at this?

…tionsClient

When the operations client tries to remove completed operations, it
retrieves the current collection of operations, removes the completed
ones, and sets the modified collection back. However, this operation
doesn't actually work because the preferences services assumes that a
modification is being made to the passed in collection and that the
entries that have been removed from the collection should not be
acted upon. To fix this, the clear flag will be defined and set to
true so that the preferences service will know that the preferences
should be overwritten with the passed in collection.

Signed-off-by: Remy Suen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant