Scope: Delete key when deleting scope#45
Merged
Conversation
Previously, to "delete" a scope, we immediately generated a new value and set() it overtop of the previous one. 1. This isn't really needed. Sometimes we deleteScope() and don't immediately access it, so doing it eagerly was un-needed 2. When using McRouter, delete() is guaranteed to be propagated while set() has a less strong guarantee Yes, this means that in some cases (hard to tell how common) delete is followed by a set() of the scope key shortly afterward and this change adds a delete where one wasn't present before. However, I think this is outweighed by point 1 above and point 2 shows that this change is important. The code as it was meant that in our odd case with a bifurcated cache, we had to issue a delete() with every set() because deleteScope() only did a set(). There is a bunch of nuance here (see iFixit/ifixit#62768).
No caller ever passed reset, so drop the dead parameter and the branches that only ran when it was true. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Is this ref: as well? |
Member
Author
I don't think so... given that the scope value is still set with I think it's still a separate issue. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Previously, to "delete" a scope, we immediately generated a new value and set() it overtop of the previous one.
Yes, this means that in some cases (hard to tell how common) delete is followed by a set() of the scope key shortly afterward and this change adds a delete where one wasn't present before.
However, I think this is outweighed by point 1 above and point 2 shows that this change is important.
The code as it was meant that in our odd case with a bifurcated cache, we had to issue a delete() with every set() because deleteScope() only did a set(). There is a bunch of nuance here (see
https://github.com/iFixit/ifixit/pull/62768).
cr_req 2 -- I want more people to be happy with this change
qa_req 0 -- CI is enough.
CC @sterlinghirsh @jarstelfox @djmetzle