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: LiveQuerySubscription.unsubscribe resolves promise before unsubscribing completes #1727

Merged
merged 4 commits into from
Feb 4, 2023

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Feb 3, 2023

Pull Request

Issue

Closes: #1720

Approach

  • Ensure promise resolves
  • Remove duplicate test

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

@parse-github-assistant
Copy link

parse-github-assistant bot commented Feb 3, 2023

Thanks for opening this pull request!

  • ❌ Please edit your post and use the provided template when creating a new pull request. This helps everyone to understand your post better and asks for essential information to quicker review the pull request.

@dplewis dplewis requested a review from a team February 3, 2023 23:02
@codecov
Copy link

codecov bot commented Feb 3, 2023

Codecov Report

Base: 99.89% // Head: 99.89% // Increases project coverage by +0.00% 🎉

Coverage data is based on head (32b8348) compared to base (6899c0f).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@           Coverage Diff           @@
##            alpha    #1727   +/-   ##
=======================================
  Coverage   99.89%   99.89%           
=======================================
  Files          61       61           
  Lines        5985     5991    +6     
  Branches     1372     1373    +1     
=======================================
+ Hits         5979     5985    +6     
  Misses          6        6           
Impacted Files Coverage Δ
src/LiveQueryClient.js 99.01% <100.00%> (+0.02%) ⬆️
src/LiveQuerySubscription.js 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

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

@mtrezza
Copy link
Member

mtrezza commented Feb 4, 2023

Is this a breaking change? If yes, can it be made a non-breaking change?

@dplewis
Copy link
Member Author

dplewis commented Feb 4, 2023

This isn't a breaking change

@mtrezza
Copy link
Member

mtrezza commented Feb 4, 2023

I'm asking because you wrote:

Using a promise would be a breaking change but would be aligned with subscribe

Just to confirm, it's not a breaking change?

@dplewis
Copy link
Member Author

dplewis commented Feb 4, 2023

I realized that unsubscribe already returned a promise. It just ran in the background and still does after this PR.

@mtrezza
Copy link
Member

mtrezza commented Feb 4, 2023

Got it, thanks for confirming, just wanted to make sure

@mtrezza
Copy link
Member

mtrezza commented Feb 4, 2023

So is this actually a bugfix then because the promise resolved before the unsub has completed? Like:

fix: LiveQuerySubscription.unsubscribe resolves promise before unsubscribing completes

@dplewis
Copy link
Member Author

dplewis commented Feb 4, 2023

Thats correct

@mtrezza mtrezza changed the title feat: Ensure live query unsubscribes fix: LiveQuerySubscription.unsubscribe resolves promise before unsubscribing completes Feb 4, 2023
Copy link
Member

@mtrezza mtrezza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

@mtrezza mtrezza merged commit 1c96205 into parse-community:alpha Feb 4, 2023
parseplatformorg pushed a commit that referenced this pull request Feb 4, 2023
# [4.0.0-alpha.8](4.0.0-alpha.7...4.0.0-alpha.8) (2023-02-04)

### Bug Fixes

* `LiveQuerySubscription.unsubscribe` resolves promise before unsubscribing completes ([#1727](#1727)) ([1c96205](1c96205))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 4.0.0-alpha.8

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Feb 4, 2023
parseplatformorg pushed a commit that referenced this pull request Mar 1, 2023
# [4.1.0-beta.1](4.0.1...4.1.0-beta.1) (2023-03-01)

### Bug Fixes

* `LiveQuerySubscription.unsubscribe` resolves promise before unsubscribing completes ([#1727](#1727)) ([1c96205](1c96205))
* Node engine version upper range is <19 despite Node 19 support ([#1732](#1732)) ([febe187](febe187))
* Saving a new `Parse.Object` with an unsaved `Parse.File` fails ([#1662](#1662)) ([16535a4](16535a4))

### Features

* `LiveQueryClient.close` returns promise when WebSocket closes ([#1735](#1735)) ([979d660](979d660))
* Upgrade Node Package Manager lock file `package-lock.json` to version 2 ([#1729](#1729)) ([e993786](e993786))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 4.1.0-beta.1

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Mar 1, 2023
parseplatformorg pushed a commit that referenced this pull request Mar 1, 2023
# [4.1.0-alpha.1](4.0.1...4.1.0-alpha.1) (2023-03-01)

### Bug Fixes

* `LiveQuerySubscription.unsubscribe` resolves promise before unsubscribing completes ([#1727](#1727)) ([1c96205](1c96205))
* Node engine version upper range is <19 despite Node 19 support ([#1732](#1732)) ([febe187](febe187))
* Saving a new `Parse.Object` with an unsaved `Parse.File` fails ([#1662](#1662)) ([16535a4](16535a4))

### Features

* `LiveQueryClient.close` returns promise when WebSocket closes ([#1735](#1735)) ([979d660](979d660))
* Upgrade Node Package Manager lock file `package-lock.json` to version 2 ([#1729](#1729)) ([e993786](e993786))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 4.1.0-alpha.1

parseplatformorg pushed a commit that referenced this pull request May 1, 2023
# [4.1.0](4.0.1...4.1.0) (2023-05-01)

### Bug Fixes

* `LiveQuerySubscription.unsubscribe` resolves promise before unsubscribing completes ([#1727](#1727)) ([1c96205](1c96205))
* Node engine version upper range is <19 despite Node 19 support ([#1732](#1732)) ([febe187](febe187))
* Saving a new `Parse.Object` with an unsaved `Parse.File` fails ([#1662](#1662)) ([16535a4](16535a4))

### Features

* `LiveQueryClient.close` returns promise when WebSocket closes ([#1735](#1735)) ([979d660](979d660))
* Upgrade Node Package Manager lock file `package-lock.json` to version 2 ([#1729](#1729)) ([e993786](e993786))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 4.1.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label May 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version state:released-beta Released as beta version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ensure live query subscription unsubscribes
3 participants