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: LiveQueryClient.resubscribe with Parse Server 7 causes many open connections #2184

Merged
merged 6 commits into from
Jun 24, 2024

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Jun 23, 2024

Pull Request

Issue

The fields attribute was changed to keys in Parse Server 7, watch was added in version 6. Resubscribing doesn't subscribe to the same query as the initial subscription. It was discovered that resubscribing with fields on version 7 will caused resubscribing every second which lead to many connections to the server ultimately resulting in a crash.

Closes: #2180

Approach

  • Add keys and watch to resubscribe
  • Fix the delay interval between resubscriptions

Tasks

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

Copy link

Thanks for opening this pull request!

Copy link

codecov bot commented Jun 23, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (d76328c) to head (46a7718).
Report is 2 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2184   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         6364      6365    +1     
  Branches      1535      1506   -29     
=========================================
+ Hits          6364      6365    +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@dplewis dplewis requested a review from a team June 23, 2024 20:14
mtrezza
mtrezza previously approved these changes Jun 24, 2024
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; @akichim21 do you want to try this out before we merge, to see whether it solves the reported bug?

@mtrezza mtrezza changed the title fix: Add keys and watch to LiveQueryClient.resubscribe fix: LiveQueryClient.resubscribe with Parse Server 7 causes many open connections Jun 24, 2024
@mtrezza
Copy link
Member

mtrezza commented Jun 24, 2024

@dplewis changed PR title to describe the issue; is the new title ok?

@dplewis
Copy link
Member Author

dplewis commented Jun 24, 2024

The title is perfect!

@mtrezza mtrezza merged commit 71b4d17 into parse-community:alpha Jun 24, 2024
11 checks passed
parseplatformorg pushed a commit that referenced this pull request Jun 24, 2024
# [5.2.0-alpha.3](5.2.0-alpha.2...5.2.0-alpha.3) (2024-06-24)

### Bug Fixes

* `LiveQueryClient.resubscribe` with Parse Server 7 causes many open connections ([#2184](#2184)) ([71b4d17](71b4d17))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.2.0-alpha.3

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jun 24, 2024
parseplatformorg pushed a commit that referenced this pull request Jun 24, 2024
# [5.2.0-beta.1](5.1.0...5.2.0-beta.1) (2024-06-24)

### Bug Fixes

* `LiveQueryClient.resubscribe` with Parse Server 7 causes many open connections ([#2184](#2184)) ([71b4d17](71b4d17))
* `Parse.Installation` not working when installation is deleted on server ([#2126](#2126)) ([22360b4](22360b4))
* Duplicate pending operations on nested fields ([#2162](#2162)) ([df6df7c](df6df7c))

### Features

* Support dot notation on array fields ([#2120](#2120)) ([25ec684](25ec684))
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Jun 24, 2024
@dplewis dplewis deleted the reconnect-keys branch June 26, 2024 04:19
parseplatformorg pushed a commit that referenced this pull request Jun 29, 2024
# [5.2.0](5.1.0...5.2.0) (2024-06-29)

### Bug Fixes

* `LiveQueryClient.resubscribe` with Parse Server 7 causes many open connections ([#2184](#2184)) ([71b4d17](71b4d17))
* `Parse.Installation` not working when installation is deleted on server ([#2126](#2126)) ([22360b4](22360b4))
* Dot notation on JSON arrays doesn't work on `PushStatus` offset fields ([#2194](#2194)) ([e0eb6f0](e0eb6f0))
* Duplicate pending operations on nested fields ([#2162](#2162)) ([df6df7c](df6df7c))

### Features

* Support dot notation on array fields ([#2120](#2120)) ([25ec684](25ec684))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.2.0

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.

Change fields in LiveQueryClient.resubscribe to keys
3 participants