-
Notifications
You must be signed in to change notification settings - Fork 31
Fixing attachment removed in PATCH when process ends #3953
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
Conversation
…receipt (i.e. changing taskId), since we get the process back earlier than we get new layouts. This should prevent node context effects from running while transitioning to a new task (essentially resetting NodesContext earlier than before).
📝 WalkthroughWalkthroughAdds task-transition awareness to the NodesContext module: introduces an internal hook to detect task transitions from navigation params, and updates the global context regeneration condition to account for in-transition state while guarding against specific end-state false positives. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes 🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
🧪 Generate unit tests (beta)
🧹 Recent nitpick comments
📜 Recent review detailsConfiguration used: Organization UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used📓 Path-based instructions (2)**/*.{ts,tsx}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
{**/*.module.css,**/*.{ts,tsx}}📄 CodeRabbit inference engine (CLAUDE.md)
Files:
🧠 Learnings (3)📚 Learning: 2025-08-28T12:25:27.289ZApplied to files:
📚 Learning: 2025-09-03T14:26:18.627ZApplied to files:
📚 Learning: 2025-11-25T12:53:54.399ZApplied to files:
🧬 Code graph analysis (1)src/utils/layout/NodesContext.tsx (2)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (3)
🔇 Additional comments (3)
✏️ Tip: You can disable this entire section by setting Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
* mapAttachments() hook returned no attachments when navigating to the receipt (i.e. changing taskId), since we get the process back earlier than we get new layouts. This should prevent node context effects from running while transitioning to a new task (essentially resetting NodesContext earlier than before). * This should fix the tests that broke (this was a bit sloppy) --------- Co-authored-by: Ole Martin Handeland <git@olemartin.org>
|
✅ Automatic backport successful! A backport PR has been automatically created for the The release branch The cherry-pick was clean with no conflicts. Please review the backport PR when it appears. |
* mapAttachments() hook returned no attachments when navigating to the receipt (i.e. changing taskId), since we get the process back earlier than we get new layouts. This should prevent node context effects from running while transitioning to a new task (essentially resetting NodesContext earlier than before). * This should fix the tests that broke (this was a bit sloppy) --------- Co-authored-by: Ole Martin Handeland <git@olemartin.org>
* mapAttachments() hook returned no attachments when navigating to the receipt (i.e. changing taskId), since we get the process back earlier than we get new layouts. This should prevent node context effects from running while transitioning to a new task (essentially resetting NodesContext earlier than before). * This should fix the tests that broke (this was a bit sloppy) --------- Co-authored-by: Ole Martin Handeland <git@olemartin.org>
* mapAttachments() hook returned no attachments when navigating to the receipt (i.e. changing taskId), since we get the process back earlier than we get new layouts. This should prevent node context effects from running while transitioning to a new task (essentially resetting NodesContext earlier than before). * This should fix the tests that broke (this was a bit sloppy) --------- Co-authored-by: Ole Martin Handeland <git@olemartin.org>



Description
This should fix a case where attachments were attempted to be removed from the form data when transitioning from a data task -> receipt. The root cause for this was
StoreAttachmentsInNodeWorkerbuilding a list of attachments for a node, and sincemapAttachments()(called fromuseNodeAttachments()) skips attachments where taskId is not the current one it would skip these attachments since the process data has been updated.Instead of a localized fix, the issue at hand is that
NodesContext(which has these 'store attachments' effects) should be reset when navigating to another task. It used to do that properly by checking the current layouts, but process data is updated before we get a response from the layouts query, thus it's an earlier indicator thatNodesContextshould reset itself.Related Issue(s)
Verification/QA
kind/*andbackport*label to this PR for proper release notes groupingSummary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.