[ZEPPELIN-6551] Fix Job Manager crash on removal broadcast for a note not in the viewer's list#5337
Open
kimyenac wants to merge 1 commit into
Open
[ZEPPELIN-6551] Fix Job Manager crash on removal broadcast for a note not in the viewer's list#5337kimyenac wants to merge 1 commit into
kimyenac wants to merge 1 commit into
Conversation
… not in the viewer's list A permanent note deletion broadcasts a field-less NoteJobInfo stub (noteName=null, isRemoved=true) to every Job Manager subscriber, while each viewer's job list is owner-filtered. For a note the viewer doesn't own, updateJobs pushed the stub (currentJobIndex === -1), then filterJobs threw "Cannot read properties of undefined (reading 'match')" on job.noteName and kept rethrowing, breaking filter/sort until re-navigation. - updateJobs: don't add removal stubs that aren't already in the list. Guard is nested (not merged into the currentJobIndex === -1 condition) so a removal stub can't fall through to the splice(-1) branch. - filterJobs: guard job.noteName with optional chaining as defense in depth. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Member
|
@kimyenac Can we add test cases for this 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.
What is this PR for?
When a note is permanently deleted, the backend broadcasts a field-less
NoteJobInfostub (noteName=null,isRemoved=true) to every Job Manager subscriber, while each viewer's initial job list is owner-filtered (JobManagerService#getNoteJobInfoByUnixTime).For a note the viewer does not own,
updateJobsfell into thecurrentJobIndex === -1branch and pushed the stub intothis.jobs.filterJobsthen ranjob.noteName.match(noteNameReg)and threwTypeError: Cannot read properties of undefined (reading 'match'). Because the stub persists inthis.jobs, every subsequentfilterJobs(each filter keystroke / job update) rethrew, so the page's filter/sort stayed broken until re-navigation.This affects any user viewing
/jobmanagerwhen another user permanently deletes a note they don't own.What does this PR do?
updateJobs: do not add removal stubs that aren't already in the list (if (!updateJob.isRemoved)). The guard is kept nested insideif (currentJobIndex === -1)rather than merged into that condition, so a removal stub can never fall through to theelsebranch'ssplice(currentJobIndex, 1)— merging would callsplice(-1, 1)and silently drop the last job.filterJobs: guardjob.noteName?.match(...)with optional chaining as defense in depth.What type of PR is it?
Bug Fix
What is the Jira issue?
How should this be tested?
cd zeppelin-web-angular && npm run lint/jobmanageras user A; as user B permanently delete a note A does not own; confirm A's page keeps filtering without a consoleTypeError.Questions: