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

Search needs to clear the store #4637

Closed
brunnre8 opened this issue Nov 1, 2022 · 0 comments
Closed

Search needs to clear the store #4637

brunnre8 opened this issue Nov 1, 2022 · 0 comments
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.

Comments

@brunnre8
Copy link
Member

brunnre8 commented Nov 1, 2022

  • The Lounge version: master branch

Currently when we search we add the results to the store.
However this is never cleared again, leading to funny artifacts

client/js/socket-events/search.ts:

socket.on("search:results", (response) => {
	store.commit("messageSearchInProgress", false);

	if (store.state.messageSearchResults) {
		store.commit("addMessageSearchResults", response);
		return;
	}

	store.commit("messageSearchResults", response);
});

After the first search is closed out, state.messageSearchResults is still non empty, meaning a second search will try to add to it, which makes no sense as it may not even be related.

/cc @MaxLeiter that's your bug 😜

@brunnre8 brunnre8 added the Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors. label Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issues that report and PRs that solve any defects that cause unexpected behaviors.
Projects
None yet
Development

No branches or pull requests

1 participant