SOLVED: Issue persisting 'Solved' state #7
Merged
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.
Problem
Previously, when a user opened a LeetCode problem page (e.g., by clicking a link from the popup or options page), the
extension’s content script would overwrite the problem’s data in storage, removing the "Solved" status and solved timestamp. This caused solved problems to appear as unsolved and disappear from the recent problems list.
Solution:
The content script was updated to always preserve the "Solved" status and solvedAt timestamp when updating problem data on page load. Now, only non-status fields (like title, difficulty, tags, etc.) are updated unless the user actually solves the problem again. The "Solved" status and solvedAt timestamp are only changed when a new solution is submitted and accepted.
Result:
Solved problems now remain marked as solved and persist in the recent problems list, regardless of how or when the user opens the problem page. This ensures accurate and consistent tracking of solved problems.
Resolves #2