Repository navigation
fix(api-aco): log FLP task triggers that fail - #5983
Conversation
The create, update and delete FLP handlers ignored a trigger that failed. TaskService.trigger() reports most failures as a failed Result, which the handlers never checked, and the catch around it dropped anything thrown. Either way the folder change stood while its FLP records were missing, out of date or left behind, with nothing in the logs. Both cases are now logged through the DI Logger with the folder id. The folder change still succeeds, as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
🚓 Slop Cop ✅ Nothing worth flagging. The diff looks consistent with the PR's stated intent and the code-style rules. Automated, non-blocking heads-up from an LLM. It can be wrong — use your judgment. Regenerates on every push. |
|
Important Review skippedReview was skipped as selected files did not have any reviewable changes. ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to
|
What was wrong
When a folder is created, updated or deleted, an event handler triggers a background task that writes the folder's FLP (folder level permission) records. If that trigger failed, the handlers dropped the failure:
TaskService.trigger()reports most failures as a failedResult, for example a step function that could not be started. The handlers never checked the result.catch { // Ignore errors }.The folder change still succeeded, but depending on the event the folder had no FLP record, kept its old permissions across its subtree, or left an orphaned record behind. Nothing was logged.
What changed
CreateFlpOnFolderCreatedHandler,UpdateFlpOnFolderUpdatedHandlerandDeleteFlpOnFolderDeletedHandlercheck the trigger result and log both failed results and thrown errors through the DILogger, along with the folder id. The folder change still succeeds as before, since it's already saved when the handler runs.The websocket notify handler for deletes is unchanged: when that send fails, an open tab shows a deleted folder until it reloads, which isn't worth an error log.
Tests
folder.flp.triggerFailures.test.tsswaps in a task service whose trigger fails, once with a failedResultand once by throwing, for create, update and delete. Each test checks that the folder change succeeds and the failure is logged. All three tests fail against the old handlers.api-aco127 passed on DynamoDB and on SQL.api-file-manager-aco,api-headless-cms-aco,api-audit-logsand the website-builder folder test pass.Workspace: wby-next1 · ✨ AI CHAT
🤖 Generated with Claude Code
Summary by CodeRabbit