Skip to content

Conversation

@HedgehogNSK
Copy link
Contributor

Hotfix for multiple subscriptions to the same UpdateType
Apply Sonar recommendations from PR #71

- Move UpdateDistributor._update initialization to constructor
- Add 'readonly' keyword to LongpollingUpdateTracker._observers
- Add 'readonly' keyword to UpdateDistributor._updateInfos
- Add 'sealed' keyword to UpdateTypeInfo
- Add 'sealed' keyword to DisposableAction
- Call Dispose method for LongpollingUpdateTracker._cancellationTokenSource
- Add class constraint to TOut parameter in CustomSubject class
@HedgehogNSK
Copy link
Contributor Author

I also found a critical bug related to disposing subscriptions and restoring the connection after the LongpollingTracker catches an exception. I'm working on it, but it's taking longer than expected. I'll let you know once I finish.

…ing issues.

- Added Observable operators:
  - `DoOnDispose`: Executes an action when the observable is disposed.
  - `DoOnSubscribe`: Executes an action when a new observer subscribes.
  - `Select`: Applies a function to each item in the observable and returns the result of that function.
  - `Switch`: Switches to the latest observable sequence when the source emits a new value.
  - `Where`: Filters the observable sequence based on a predicate.

- Added `ReactiveProperty` for easier state management.
- Removed unnecessary `CustomSubject` and `UpdateSubject`.
- Fixed exception handling in `LongpollingUpdateTracker`.
@HedgehogNSK
Copy link
Contributor Author

Done. I had to implement several RX operators to avoid external dependencies and solve the task. They might be useful in other parts of the library as well, since the library aims to minimize external dependencies.

I've been testing the updated code with both fake and real connection exceptions, and so far, I haven't broken it.

@niklasweimann niklasweimann merged commit 1343adf into RxTelegram:rework_updatemanager Mar 11, 2025
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.

2 participants