-
Notifications
You must be signed in to change notification settings - Fork 19
ECHO-527 ongoing conversation tag issue resolved #368
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -658,7 +658,7 @@ export const useConversationsByProjectId = ( | |
| query?: Partial<Query<CustomDirectusTypes, Conversation>>, | ||
| filterBySource?: string[], | ||
| ) => { | ||
| const TIME_INTERVAL_SECONDS = 40; | ||
| const TIME_INTERVAL_SECONDS = 30; | ||
|
|
||
|
Comment on lines
+661
to
662
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧹 Nitpick | 🔵 Trivial Wire refetchInterval to TIME_INTERVAL_SECONDS to avoid future drift Right now you’ve got I’d tie the polling to the same constant: - export const useConversationsByProjectId = (
+ export const useConversationsByProjectId = (
@@
- const TIME_INTERVAL_SECONDS = 30;
+ const TIME_INTERVAL_SECONDS = 30;
@@
- refetchInterval: 30000,
+ refetchInterval: TIME_INTERVAL_SECONDS * 1000,
@@
-export const useInfiniteConversationsByProjectId = (
+export const useInfiniteConversationsByProjectId = (
@@
- const TIME_INTERVAL_SECONDS = 30;
+ const TIME_INTERVAL_SECONDS = 30;
@@
- refetchInterval: 30000,
+ refetchInterval: TIME_INTERVAL_SECONDS * 1000,Keeps the “live window” and polling cadence locked together. Also applies to: 732-733, 872-873, 955-956 🤖 Prompt for AI Agents |
||
| return useQuery({ | ||
| queryFn: async () => { | ||
|
|
@@ -667,6 +667,7 @@ export const useConversationsByProjectId = ( | |
| deep: { | ||
| chunks: { | ||
| _limit: loadChunks ? 1000 : 1, | ||
| _sort: ["-timestamp", "-created_at"], | ||
| }, | ||
| }, | ||
| fields: [ | ||
|
|
@@ -868,7 +869,7 @@ export const useInfiniteConversationsByProjectId = ( | |
| }, | ||
| ) => { | ||
| const { initialLimit = 15 } = options ?? {}; | ||
| const TIME_INTERVAL_SECONDS = 40; | ||
| const TIME_INTERVAL_SECONDS = 30; | ||
|
|
||
| return useInfiniteQuery({ | ||
| getNextPageParam: (lastPage: { nextOffset?: number }) => | ||
|
|
@@ -880,6 +881,7 @@ export const useInfiniteConversationsByProjectId = ( | |
| deep: { | ||
| chunks: { | ||
| _limit: loadChunks ? 1000 : 1, | ||
| _sort: ["-timestamp", "-created_at"], | ||
| }, | ||
| }, | ||
| fields: [ | ||
|
|
||
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.
🧹 Nitpick | 🔵 Trivial
Make the nested project_id filter explicit under conversation_id
Minor clarity/readability nit: you’re currently relying on implicit equality sugar for the nested project filter:
I’d make this explicit so nobody has to mentally expand the Directus filter rules and so TypeScript tooling doesn’t get confused by the nesting:
Functionally the same intent, but clearer to future readers and less magical.
🤖 Prompt for AI Agents