docs: update AGENTS and backend error handling documentation; add README for backend#1573
Merged
tyler-dane merged 2 commits intomainfrom Mar 27, 2026
Merged
docs: update AGENTS and backend error handling documentation; add README for backend#1573tyler-dane merged 2 commits intomainfrom
tyler-dane merged 2 commits intomainfrom
Conversation
…DME for backend - Added a new instruction to run ESLint on changed files as a required validation step in AGENTS.md. - Enhanced backend error handling documentation with principles to minimize `try/catch` blocks. - Introduced a README for the backend, outlining its current integration with Google Calendar and the need for decoupling from it for future flexibility.
| return this.startWatchingGcalCalendars(userId, params, gcal); | ||
| default: | ||
| return this.startWatchingGcalEvents(userId, params, gcal); | ||
| if (params.gCalendarId === "calendarlist") { |
Contributor
There was a problem hiding this comment.
Hardcoded string replaces imported constant for calendar check
Low Severity
The comparison uses the hardcoded string "calendarlist" instead of the already-imported Resource_Sync.CALENDAR constant. Every other reference in this file (lines 522, 527, 549) and across the codebase uses the constant. This introduces a maintenance risk — if Resource_Sync.CALENDAR changes, this check silently breaks.
…in sync service - Updated the `signOutPOST` function in the supertokens middleware to utilize a marker for response consistency. - Refactored the session sign-out handling to improve clarity and maintainability. - Enhanced logging in the `SyncService` to provide more informative debug messages when stopping Google Calendar event watches.
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.


try/catchblocks.Note
Medium Risk
Touches authentication sign-out and Google sync watch cleanup paths; mistakes could leave stale watch records or skip expected metadata resets, though changes are covered by new/updated unit tests.
Overview
Centralizes backend logout cleanup by routing SuperTokens
signOutPOSTthrough a newuserService.handleLogoutCleanup()(now wrapped intry/catchso sign-out still succeeds if cleanup fails), and updates tests to assert correct delegation and context preservation.Hardens Google sync/watch behavior by adding shared
isMissingGoogleRefreshToken()helper, validatingimportGCalrequests with zod (ImportGCalRequestSchema), and makingsyncService.stopWatches()return early (and avoid creating a GCal client) when no watches exist or when the user lacks a refresh token (deleting local watch records instead). Also tightens sync maintenance logging counts.Docs updates: adds backend README, expands backend error-handling principles, and updates
AGENTS.mdworkflow to require running eslint on changed implementation files and to alphabetize new functions.Written by Cursor Bugbot for commit 9fe30d0. This will update automatically on new commits. Configure here.