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
feat: re-fetch conversations on opening search-ui [FS-1689] #15030
Conversation
Codecov Report
@@ Coverage Diff @@
## dev #15030 +/- ##
==========================================
- Coverage 43.31% 43.16% -0.16%
==========================================
Files 643 644 +1
Lines 21551 21633 +82
Branches 4933 4955 +22
==========================================
+ Hits 9335 9337 +2
- Misses 11029 11104 +75
- Partials 1187 1192 +5 |
const updateConversations = async () => { | ||
await conversationRepository.loadMissingConversations(); | ||
}; | ||
void updateConversations(); |
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.
const updateConversations = async () => { | |
await conversationRepository.loadMissingConversations(); | |
}; | |
void updateConversations(); | |
void conversationRepository.loadMissingConversations(); |
this.logger.error(`Failed to get all conversations from backend: ${error.message}`); | ||
return {found: [], failed: missingConversations} as RemoteConversations; | ||
}); | ||
missingConversations.splice(0, missingConversations.length); |
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.
missingConversations.splice(0, missingConversations.length); | |
this.conversationState.missingConversations = []; |
more straightforward and easier to understand I believe
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.
Actually this might be a bug, you don't want to reset
the state when the request failed.
There might be some things to improve there.
You only want to remove the ones that were succesfully fetched on backend
Co-authored-by: Przemysław Jóźwik <przemyslaw.jozwik@wire.com>
Feature
load missed conversations on opening the search ui
Step by step:
loadConversations()
returns the new conversation as failed