crossbario / crossbario/autobahn-python
Subscribing with get_retained=True calls previous subscriber
Open
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 2.5k
- Forks
- 768
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
It appears that subscribing to a topic with options=SubscribeOptions(get_retained=True) causes previous subscribers to get called again. For example, suppose that someone has already posted 'bar' to a topic 'foo', and we run this:
def f1(msg):
print(f"f1({msg})")
def f2(msg):
print(f"f2({msg})")
def f3(msg):
print(f"f3({msg})")
await session.subscribe(f1, 'foo', options=SubscribeOptions(get_retained=True))
await session.subscribe(f2, 'foo', options=SubscribeOptions(get_retained=True))
await session.subscribe(f3, 'foo', options=SubscribeOptions(get_retained=True))
What will get printed is:
f1(bar)
f1(bar)
f2(bar)
f1(bar)
f2(bar)
f3(bar)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the three-subscription example from the issue and trace the subscription and retained-message handling. Done means subscribing with get_retained=True delivers the retained message to the new callback without invoking previous subscribers again.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- api
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100