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 a bug when unsub from a non-subscribed parent topic #297

Merged
merged 4 commits into from
Jun 5, 2023

Conversation

xiazhvera
Copy link
Contributor

@xiazhvera xiazhvera commented Jun 2, 2023

Issue #, if available:
awslabs/aws-crt-nodejs#405

Description of changes:
The issue happens when the application tries to unsubscribe from a non-subscribed parent topic. As an example:

Subscribe(test/topic/child)
Unsubscribe(test/topic)

As the "test/topic" is never subscribed, the topic tree would not delete the topic.
However, topic tree would treat the topic as "deleted" and tries to update the underlying topic filter, which hits the assertion.
Fixed it by validating if the topic is deleted before proceed to next step.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@xiazhvera xiazhvera changed the title Fix a bug when unsub from a non-subscribed parent topic [WIP]Fix a bug when unsub from a non-subscribed parent topic Jun 2, 2023
@codecov-commenter
Copy link

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (a760f42) 80.34% compared to head (da001a3) 80.34%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #297   +/-   ##
=======================================
  Coverage   80.34%   80.34%           
=======================================
  Files          18       18           
  Lines        7571     7571           
=======================================
  Hits         6083     6083           
  Misses       1488     1488           
Impacted Files Coverage Δ
source/topic_tree.c 89.51% <100.00%> (ø)

☔ View full report in Codecov by Sentry.
📢 Do you have feedback about the report comment? Let us know in this issue.

@xiazhvera xiazhvera changed the title [WIP]Fix a bug when unsub from a non-subscribed parent topic Fix a bug when unsub from a non-subscribed parent topic Jun 2, 2023
@xiazhvera xiazhvera merged commit b3ac03e into main Jun 5, 2023
31 checks passed
@xiazhvera xiazhvera deleted the nodejs405_unsub branch June 5, 2023 16:00
@xiazhvera xiazhvera mentioned this pull request Jun 5, 2023
bretambrose pushed a commit that referenced this pull request Jun 5, 2023
* update tests for unsubscribe crash

* update comments
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.

None yet

4 participants