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

BP-1200: Fix subscription to doc updates #342

Merged
merged 5 commits into from
Sep 13, 2024

Conversation

andreparames
Copy link
Contributor

@andreparames andreparames commented Sep 2, 2024

The main change in this PR is changing the subscription pattern to get updates from changes to all documents, not just those containing Labels. The reason this wasn't done earlier was because it triggered a different bug, which is also fixed in this PR.

The messages of the commits are reproduced here:

The frontend is not getting the events from Redis when packages are imported. This is because it was only subscribed to records with Labels, and not all records have them. This commit makes the pattern of the subscription wider, so that all events are sent from the backend.

The code was assuming that the event data of an updated record/document always contained its Name. But sometimes the pattern may not be a subscription to that specific document, but a more generic one (like Name:"*"), and so in that case, the first pattern may not matched that assumption. This commit updates the code to read the document name from the event's "key" structure instead.

See also the ticket for extra information: BP-1200


  • Make sure you are opening from a topic/feature/bugfix branch
  • Ensure that the PR title represents the desired changes
  • Ensure that the PR description detail the desired changes
  • Link to relevant issues in GitHub or Jira
  • [ ] Link to relevant pull requests, esp. upstream and downstream changes
  • [ ] Ensure you have provided tests - that demonstrates feature works or fixes the issue

The frontend is not getting the events from Redis when packages
are imported. This is because it was only subscribed to records
with Labels, and not all records have them. This commit makes
the pattern of the subscription wider, so that all events are
sent from the backend.
The code was assuming that the event data of an updated
record/document always contained its Name. But sometimes the
pattern may not be a subscription to that specific document, but
a more generic one (like Name:"*"), and so in that case, the first
pattern may not matched that assumption.

This commit updates the code to read the document name from the
event's "key" structure instead.
@andreparames andreparames added the bug Something isn't working label Sep 2, 2024
@andreparames andreparames self-assigned this Sep 2, 2024
@andreparames andreparames requested a review from a team as a code owner September 2, 2024 14:59
@andreparames
Copy link
Contributor Author

I ran some manual tests and the qa_ui_tests, and couldn't detect any issues related to the changes.

quirinpa
quirinpa previously approved these changes Sep 10, 2024
diasnad
diasnad previously approved these changes Sep 12, 2024
@diasnad diasnad dismissed stale reviews from quirinpa and themself via 623b467 September 12, 2024 14:15
Copy link

sonarcloud bot commented Sep 12, 2024

@diasnad diasnad self-requested a review September 12, 2024 14:22
@diasnad diasnad merged commit 693d48f into dev Sep 13, 2024
5 checks passed
@diasdm diasdm deleted the bugfix/BP-1200/fix-subscription-to-doc-updates branch October 14, 2024 09:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants