Commit def6e82
authored
ENG-1815 Add sync attempt telemetry and stale end-task handling (#1094)
* Implement end_sync_task function with JSON response and telemetry context
- Refactor end_sync_task to return a JSON object containing task status and metadata.
- Enhance error handling to include telemetry context for better debugging.
- Update related API routes and database schema to accommodate new return type.
- Document changes in sync_functions.md to reflect the new response structure.
* Refactor sync task handling to include claimed timestamp and improve error responses
- Update EndSyncTaskRpcResult to require 'ok' and 'stale' fields.
- Enhance isEndSyncTaskRpcResult function to validate response structure.
- Modify endSyncTask function to handle claimed timestamps and improve error handling.
- Update API route to parse and validate request body for task status and timestamps.
- Document changes in sync_functions.md to reflect new requirements for end_sync_task.
* Restored the worker guard
* Update end_sync_task API to allow optional startedAt parameter and improve request body validation
- Made 'startedAt' in ParsedEndSyncTaskBody optional.
- Enhanced parseEndSyncTaskBody to accept a task status string directly.
- Updated error messages for better clarity on request body requirements.
- Adjusted RPC call to conditionally include 's_started_at' based on availability.
* Remove unnecessary success assignment in createOrUpdateDiscourseEmbedding function to streamline error handling.
* add a version to the JSON output1 parent 1f9145b commit def6e82
6 files changed
Lines changed: 778 additions & 77 deletions
File tree
- apps
- roam/src/utils
- website/app/api/supabase/sync-task/[fn]/[target]/[worker]
- packages/database
- doc
- src
- supabase
- migrations
- schemas
0 commit comments