-
-
Notifications
You must be signed in to change notification settings - Fork 0
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
Adds Backend subscriptions for WebSockets events, and applies them to Mobile #144
base: dev
Are you sure you want to change the base?
Conversation
…itching from redis client to ioredis (mostly drop-in replacement)
…criptions for mutations
…on, including Mobile components and function. Also removes unused constants and re-locates RESP_* constants into useHasResponsibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool!
@tibetsprague aH yes, I kinda accidentally marked for review early. Will assign you and Tom again once it is ready ready sometime in the next day or so. There is a bit more refinement coming with the final message implementations, but it's mostly here. It was pretty rough getting through the layers, but once things started working it became pretty satisfying. May still switch to WebSocket underneath instead of HTTP2/Events, not sure yet. It should mostly just be an adapter change if I do though. There are definitely some wins here, which like a lot of this stuff, we'll feel more later. |
…ve a more clear implementation
…criptions to send WebSockets events from backend until Web is converted)
apps/backend/docs/20250124 - Proposal - AutoSubscriptionsForMutations.md
Outdated
Show resolved
Hide resolved
…ql return type to support Notification, MessageThread, and Message
… to userTyping WebSocket event. Fixes Messages isTyping in web. Clean-up of unused code and notes.
…rom comments parentCommentId to simply commentId. PR review fix.
@@ -56,7 +56,7 @@ export default function TabsNavigator () { | |||
<Tabs.Navigator {...navigatorProps}> | |||
<Tabs.Screen name='Home Tab' component={HomeNavigator} /> | |||
<Tabs.Screen name='Search Tab' component={SearchNavigator} /> | |||
<Tabs.Screen name='Messages Tab' component={MessagesNavigator} /> | |||
<Tabs.Screen name='Messages Tab' component={MessagesNavigator} options={{ tabBarBadge: 999 }} /> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whats this do?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A bookmark for badges to come. Quite unmissable in the UI
|
||
switch (update?.__typename) { | ||
case 'Message': { | ||
console.log('!!!! updates TODO: new Message. Increment Messages tab badge', result, args) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As mentioned in the perhaps tl;dr description:), managing badges is out of scope in this PR and "coming soon". The logging, and the 999 badge on the Messages tab are meant as book marks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Features summary
updates
: Streams new Messages, MessageThreads, and Notifications for the current user through a new Update grapqhl union type.peopleTyping
: Along with the paired peopleTyping mutation andusePeopleTyping
hook which should be re-usable in Web, handles typing state. Is applied to either a messageThreadId, postId, or commentId.comments
: Streams new comments for a given postId or commentId (implicitly a parentCommentId). Currently applied only in PostDetails on Mobile for parent comments (no UI impact at the moment), perhaps has other possible near-term applications.Focus recommendations for review
For the review there is a lot to pay attention to, but recommended focus is:
api/graphql/index.js
andapi/graphql/makeSubscriptions.js
.useSubscription
in mobile inAuthRootNavigator
,Thread
,usePeopleTyping
, andPostDetails
.apps/mobile/urlq-shared/updates.js
with regard to the Subscriptions.peopleTyping
subscription and mutation (small fix on Web for Messages isTyping)Additional detail and follow-on development notes
Resolving Mobile UI badge updates and any fine-grained URQL caching updates are out-of-scope for this branch.
Messages conversion status:
Remaining dev todos: