This part of code has been exctraced in response to comments on D4941 (so it can be reused there)
Function searchForPersonalThread has been written in advance. It executes the query and returns it's result
Details
Like D397
Diff Detail
- Repository
- rCOMM Comm
- Lint
No Lint Coverage - Unit
No Test Coverage
Event Timeline
What about putting the new query into thread-selectors file?
keyserver/src/search/threads.js | ||
---|---|---|
12 ↗ | (On Diff #16076) | We should almost never use any: it basically turns off Flow checks and can leak to other places https://flow.org/en/docs/types/any/. Does the library provide a type of SQL expression? |
13–23 ↗ | (On Diff #16076) | This is really a nit, but we format our SQL in a particular way: each indentation is exactly 2 spaces long, including the first one. |
Make fetchPersonalThreadID retrun a string instead of QueryResults, as they only contain one thread ID for this query anyway
fetchPersonalThreadID is tested with D4941 - when chat between commbot and ashoat user for reporting messages exists, its ID will be fetched using fetchPersonalThreadID. If the function works correctly no new chat will be created for message report when a message report is sent, and new report will appear in the existing chat .
keyserver/src/fetchers/thread-fetchers.js | ||
---|---|---|
231 | Not sure if Prettier is forcing this, but I think this line should be indented less (aligned with return) |
keyserver/src/fetchers/thread-fetchers.js | ||
---|---|---|
231 ↗ | (On Diff #17225) |