A first-time subscribe abandoned by a Reopen is silently lost

Open
#274 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
62/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
typescript
Domain
api

Research direction

Start by tracing the rejection handling in the new-subscribe path and compare it with the subscribeAll resubscribe path described in the issue. Verify that an abandoned subscribe rejects to its caller while the subscription map retains the stated behavior, and confirm the next Login can still rebuild existing subscriptions.

Written by the indexing model from the issue text.

Description

subscribe catches every rejection, abandonment included, and resolves undefined. No entry is written to the subscription map, which is correct — but that also means the stream is in neither the map nor any retry, so subscribeAll on the next Login cannot rebuild it, and the caller got undefined rather than an error it could act on.

This affects new subscribes only. A subscribeAll resubscribe keeps its pre-existing entry on failure, so those do recover.

Expected

An abandoned subscribe rejects to its caller. The rule about which rejections forget a subscription governs the map, not whether the caller hears about the failure.

Dominant language
TypeScript
Stars
146
Forks
101
PR merge metrics
No merged PRs in 30d

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from RocketChat/Rocket.Chat.js.SDK

All issues in RocketChat/Rocket.Chat.js.SDK

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.