feat: implement sprint event handling and real-time updates#295
Merged
Conversation
- Added sprint event topics for creation, update, deletion, and completion. - Integrated real-time notifications for sprint changes in the sprint service. - Updated permissions to include sprint-related events. - Enhanced plugin API client to support sprint operations. - Refactored project and interaction layouts to utilize new plugin base props. - Removed unnecessary polling for sprints, leveraging socket-driven updates instead.
Contributor
There was a problem hiding this comment.
Important
This PR lands the sprint real-time pipeline cleanly, but the new host-side plugin API client uses plain fetch and bypasses the app's axios 401 -> /auth/refresh interceptor queue. Plugin fetches will fail when the access cookie expires instead of recovering like host API calls.
Reviewed changes — sprint event topics, real-time cache invalidation, realtime permissions, plugin host base props/API client, and a new WASM db_query2 export.
- Sprint event topics and publishing —
services/api/internal/events/topics.goaddssprint.*;sprint_service.gopublishes after create, update, delete, and complete. - Socket-driven sprints refresh —
useProjectRealtimenow invalidates["projects", projectId, "sprints"], and the sidebar drops its 30s polling interval. - Realtime permissions —
services/realtimeadds asprintsnamespace gated by the existingsprints.readpermission. - Plugin host props — new
usePluginBasePropsbuilds{ api, ui, meta }andInteractionLayoutforwards it plusviewIdto plugin views. - Plugin API client — new
apps/web/src/lib/plugins/plugin-client.tsduck-types the SDK'sPluginApiClientcontract. - WASM
db_query2— new export reports query execution errors back to plugins without changing the olddb_querysignature.
Kimi K2 (free via Pullfrog for OSS) | 𝕏
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.

Summary
Moves sprints from interval polling to socket-driven real-time updates, and adds the shared plugin
api/ui/metaprops scaffolding that plugin view/nav components expect.Sprint real-time updates
sprint.created/sprint.updated/sprint.deleted/sprint.completedtopics and publish them fromsprint_service.goon every mutation (best-effort — publish failures never block the HTTP response).sprintsnamespace to the realtime service (permissions.ts/server.ts/subscriber.ts), gated on thesprints.readpermission, mirroring the existingtasks/docs/workflowsnamespaces.useProjectRealtimenow invalidates["projects", projectId, "sprints"]onsprint.*events.refetchInterval: 30_000on the sprints query now that it updates live.Plugin base props (
api/ui/meta)usePluginBaseProps(plugin-props.ts), which builds theBaseExtensionPropsevery plugin extension-point component expects: anapiclient,ui(toast/confirm stubs + a realnavigate), andmeta(plugin id/name/version).createPluginApiClient(plugin-client.ts), a duck-typed host implementation of the plugin SDK'sPluginApiClient(fetch-based, session-cookie auth) coveringlistTasks/getTask/getProject/listMembersand genericpluginGet/pluginPost/pluginPatch/pluginDelete.viewextension point inInteractionLayout, and into both the admin and project plugin nav routes (previously those routes passed no/partial props to mounted plugin components).ExtensionPointRegistrationgained an optionalLabelfield for host-facing display names (falls back toComponent).Plugin runtime:
db_query2db_query2WASM export inruntime.gothat reports query execution errors back to the plugin. The existingdb_queryhas no error channel, so a failing query (e.g. bad column reference) silently looks like a zero-row success — added as a new export rather than changingdb_queryin place, since widening its signature would break already-compiled plugin binaries that still import the 6-arg form.Misc
useProjectPermissionsnow guards its query withenabled: !!projectId.