Skip to content
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

Fix jmap request to server is called when query string is empty in quick search web #3276

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

dab246
Copy link
Member

@dab246 dab246 commented Nov 15, 2024

Issue

  • Jmap request to server is called when query string is empty in quick search web
issue-jmap-called-when-search-empty.mov

Root cause

  • Using Timer to debounce, but it doesn't work properly.

Solution

-Using debounce_throttle to debounce

Resolved

Screen.Recording.2024-11-15.at.15.35.08.online-video-cutter.com.mp4

Copy link

This PR has been deployed to https://linagora.github.io/tmail-flutter/3276.

@hoangdat
Copy link
Member

hoangdat commented Nov 15, 2024

  • da is requested and dat also. It is not optimized for searching
  • write the integration test to make sure: request only be sent after user stop typing for a while (Ex: 300 ms)

@dab246
Copy link
Member Author

dab246 commented Nov 18, 2024

  • da is requested and dat also. It is not optimized for searching

Fixed.

Screen.Recording.2024-11-18.at.01.44.15.mov
  • write the integration test to make sure: request only be sent after user stop typing for a while (Ex: 300 ms)

Currently, we don't have integration test on web.

hoangdat
hoangdat previously approved these changes Nov 18, 2024

Future<Iterable<P>?> _getListContact(String queryString) async {
try {
return widget.contactSuggestionCallback?.call(queryString);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should await here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, updated


Future<Iterable<T>?> _getListSuggestion(String queryString) async {
try {
return widget.suggestionsCallback?.call(queryString);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated


Future<Iterable<R>?> _getListRecent(String queryString) async {
try {
return widget.fetchRecentActionCallback?.call(queryString);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idem

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@hoangdat hoangdat self-requested a review November 18, 2024 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants