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

feat(search): filter out messages from non-viewable channels #5161

Merged
merged 1 commit into from
May 16, 2024

Conversation

jrainville
Copy link
Member

Fixes status-im/status-desktop#14586

Make sure to filter out the non-viewable channels from the search results before sending back

Test run 1000 times:

go test -test.count 1000 -run MessengerCommunitiesTokenPermissionsSuite/TestSearchMessageinPermissionedChannel -failfast -timeout 3000s -tags gowaku_skip_migrations,gowaku_no_rln
PASS
ok  	github.com/status-im/status-go/protocol	1732.973s

@status-im-auto
Copy link
Member

status-im-auto commented May 14, 2024

Jenkins Builds

Click to see older builds (8)
Commit #️⃣ Finished (UTC) Duration Platform Result
✖️ 09d51a3 #1 2024-05-14 21:14:56 ~1 min tests 📄log
✔️ 09d51a3 #1 2024-05-14 21:18:04 ~4 min linux 📦zip
✔️ 09d51a3 #1 2024-05-14 21:19:01 ~5 min ios 📦zip
✔️ 09d51a3 #1 2024-05-14 21:19:43 ~6 min android 📦aar
✔️ 49b90f1 #2 2024-05-15 18:17:10 ~3 min linux 📦zip
✔️ 49b90f1 #2 2024-05-15 18:17:16 ~3 min android 📦aar
✔️ 49b90f1 #2 2024-05-15 18:17:45 ~3 min ios 📦zip
✔️ 49b90f1 #2 2024-05-15 18:58:30 ~44 min tests 📄log
Commit #️⃣ Finished (UTC) Duration Platform Result
✔️ d86769b #3 2024-05-16 15:24:16 ~3 min android 📦aar
✔️ d86769b #3 2024-05-16 15:25:46 ~4 min linux 📦zip
✔️ d86769b #3 2024-05-16 15:25:57 ~4 min ios 📦zip
✔️ d86769b #3 2024-05-16 16:05:39 ~44 min tests 📄log

@jrainville jrainville force-pushed the fix/leaked-channels-in-search branch from 09d51a3 to 49b90f1 Compare May 15, 2024 18:13
Comment on lines 4386 to 4403
if err != nil {
return nil, err
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if err != nil {
return nil, err
}
if err != nil {
if err == communities.ErrOrgNotFound {
continue
}
return nil, err
}

Otherwise, if a community is removed but the message stays, the search will be broken.

Copy link
Member Author

Choose a reason for hiding this comment

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

I'm pretty sure we don't delete the community from the DB, but better safe than sorry

@jrainville jrainville force-pushed the fix/leaked-channels-in-search branch from 49b90f1 to d86769b Compare May 16, 2024 15:20
@jrainville jrainville merged commit ae08ba6 into develop May 16, 2024
9 checks passed
@jrainville jrainville deleted the fix/leaked-channels-in-search branch May 16, 2024 16:41
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.

Hidden channels appear in search if previous messages were unencrypted
3 participants