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: LiveQuery server is not shut down properly when handleShutdown is called #8491

Merged
merged 40 commits into from
Jun 8, 2023

Conversation

dblythy
Copy link
Member

@dblythy dblythy commented Mar 30, 2023

Pull Request

Issue

When using startLiveQueryServer, the LQ server isn't shutdown after tests. This can be verified with:

const server = await reconfigureServer({
      liveQuery: {
        classNames: ['TestObject'],
      },
      startLiveQueryServer: true,
    });
await server.handleShutdown();
await new Promise(resolve => setTimeout(resolve, 100));
expect(server.liveQueryServer.server.address()).toBeNull(); // liveQuery server has an address

Closes: #8424

Approach

Closes LQ Server at handleShutdown

Tasks

  • Add tests

mtrezza and others added 23 commits March 25, 2022 19:47
## [5.2.1-alpha.1](parse-community/parse-server@5.2.0...5.2.1-alpha.1) (2022-03-26)

### Bug Fixes

* return correct response when revert is used in beforeSave ([parse-community#7839](parse-community#7839)) ([f63fb2b](parse-community@f63fb2b))
## [5.2.1-alpha.2](parse-community/parse-server@5.2.1-alpha.1...5.2.1-alpha.2) (2022-03-26)

### Performance Improvements

* reduce database operations when using the constant parameter in Cloud Function validation ([parse-community#7892](parse-community#7892)) ([48bd512](parse-community@48bd512))
# [5.3.0-alpha.2](parse-community/parse-server@5.3.0-alpha.1...5.3.0-alpha.2) (2022-03-27)

### Bug Fixes

* security upgrade parse push adapter from 4.1.0 to 4.1.2 ([parse-community#7893](parse-community#7893)) ([ef56e98](parse-community@ef56e98))
@parse-github-assistant
Copy link

I will reformat the title to use the proper commit message syntax.

@parse-github-assistant parse-github-assistant bot changed the title fix: shutdown liveQuery server properly when handleShutdown is called fix: Shutdown liveQuery server properly when handleShutdown is called Mar 30, 2023
@parse-github-assistant
Copy link

Thanks for opening this pull request!

@codecov
Copy link

codecov bot commented Mar 30, 2023

Codecov Report

Patch coverage: 92.85% and project coverage change: +0.10 🎉

Comparison is base (656d673) 94.32% compared to head (5ce1f17) 94.43%.

❗ Current head 5ce1f17 differs from pull request most recent head 91c0bdb. Consider uploading reports for the commit 91c0bdb to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##            alpha    #8491      +/-   ##
==========================================
+ Coverage   94.32%   94.43%   +0.10%     
==========================================
  Files         183      183              
  Lines       14582    14594      +12     
==========================================
+ Hits        13755    13782      +27     
+ Misses        827      812      -15     
Impacted Files Coverage Δ
src/Adapters/Storage/Mongo/MongoStorageAdapter.js 92.19% <66.66%> (+0.01%) ⬆️
...dapters/Storage/Postgres/PostgresStorageAdapter.js 95.74% <100.00%> (+<0.01%) ⬆️
src/LiveQuery/ParseLiveQueryServer.js 96.03% <100.00%> (+0.04%) ⬆️
src/ParseServer.js 97.44% <100.00%> (+4.80%) ⬆️

... and 5 files with indirect coverage changes

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

@dplewis
Copy link
Member

dplewis commented Apr 1, 2023

Looks good!

@mtrezza mtrezza changed the title fix: Shutdown liveQuery server properly when handleShutdown is called fix: LiveQuery server is not shut down properly when handleShutdown is called Apr 2, 2023
@mtrezza
Copy link
Member

mtrezza commented Apr 10, 2023

Waiting for CI to pass...

For some reason it seems that no runner is picking up ci / Check Definitions (pull_request). Maybe the ubuntu version is too old - could you try to change it from ubuntu-18.04 to ubuntu-latest?

@dblythy
Copy link
Member Author

dblythy commented Apr 11, 2023

Addressed in #8503

@mtrezza
Copy link
Member

mtrezza commented Apr 11, 2023

Rebasing...

@mtrezza
Copy link
Member

mtrezza commented Apr 11, 2023

Could you take a look at the failing definitions check?

@mtrezza
Copy link
Member

mtrezza commented Apr 14, 2023

Is this ready for merge?

Signed-off-by: Manuel <5673677+mtrezza@users.noreply.github.com>
@mtrezza
Copy link
Member

mtrezza commented Jun 8, 2023

@dblythy is this ready for merge (if CI passes)?

@dblythy
Copy link
Member Author

dblythy commented Jun 8, 2023

Yep!

@mtrezza mtrezza merged commit 967700b into parse-community:alpha Jun 8, 2023
parseplatformorg pushed a commit that referenced this pull request Jun 8, 2023
# [6.1.0-alpha.19](6.1.0-alpha.18...6.1.0-alpha.19) (2023-06-08)

### Bug Fixes

* LiveQuery server is not shut down properly when `handleShutdown` is called ([#8491](#8491)) ([967700b](967700b))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.1.0-alpha.19

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Jun 8, 2023
parseplatformorg pushed a commit that referenced this pull request Jun 10, 2023
# [6.3.0-beta.1](6.2.0...6.3.0-beta.1) (2023-06-10)

### Bug Fixes

* Cloud Code Trigger `afterSave` executes even if not set ([#8520](#8520)) ([afd0515](afd0515))
* GridFS file storage doesn't work with certain `enableSchemaHooks` settings ([#8467](#8467)) ([d4cda4b](d4cda4b))
* Inaccurate table total row count for PostgreSQL ([#8511](#8511)) ([0823a02](0823a02))
* LiveQuery server is not shut down properly when `handleShutdown` is called ([#8491](#8491)) ([967700b](967700b))
* Rate limit feature is incompatible with Node 14 ([#8578](#8578)) ([f911f2c](f911f2c))
* Unnecessary log entries by `extendSessionOnUse` ([#8562](#8562)) ([fd6a007](fd6a007))

### Features

* `extendSessionOnUse` to automatically renew Parse Sessions ([#8505](#8505)) ([6f885d3](6f885d3))
* Add new Parse Server option `preventSignupWithUnverifiedEmail` to prevent returning a user without session token on sign-up with unverified email address ([#8451](#8451)) ([82da308](82da308))
* Add option to change the log level of logs emitted by Cloud Functions ([#8530](#8530)) ([2caea31](2caea31))
* Add support for `$eq` query constraint in LiveQuery ([#8614](#8614)) ([656d673](656d673))
* Add zones for rate limiting by `ip`, `user`, `session`, `global` ([#8508](#8508)) ([03fba97](03fba97))
* Allow `Parse.Object` pointers in Cloud Code arguments ([#8490](#8490)) ([28aeda3](28aeda3))

### Reverts

* fix: Inaccurate table total row count for PostgreSQL ([6722110](6722110))
@parseplatformorg
Copy link
Contributor

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

@parseplatformorg parseplatformorg added the state:released-beta Released as beta version label Jun 10, 2023
parseplatformorg pushed a commit that referenced this pull request Jun 18, 2023
# [6.3.0-alpha.1](6.2.0...6.3.0-alpha.1) (2023-06-18)

### Bug Fixes

* Cloud Code Trigger `afterSave` executes even if not set ([#8520](#8520)) ([afd0515](afd0515))
* GridFS file storage doesn't work with certain `enableSchemaHooks` settings ([#8467](#8467)) ([d4cda4b](d4cda4b))
* Inaccurate table total row count for PostgreSQL ([#8511](#8511)) ([0823a02](0823a02))
* LiveQuery server is not shut down properly when `handleShutdown` is called ([#8491](#8491)) ([967700b](967700b))
* Rate limit feature is incompatible with Node 14 ([#8578](#8578)) ([f911f2c](f911f2c))
* Unnecessary log entries by `extendSessionOnUse` ([#8562](#8562)) ([fd6a007](fd6a007))

### Features

* `extendSessionOnUse` to automatically renew Parse Sessions ([#8505](#8505)) ([6f885d3](6f885d3))
* Add new Parse Server option `preventSignupWithUnverifiedEmail` to prevent returning a user without session token on sign-up with unverified email address ([#8451](#8451)) ([82da308](82da308))
* Add option to change the log level of logs emitted by Cloud Functions ([#8530](#8530)) ([2caea31](2caea31))
* Add support for `$eq` query constraint in LiveQuery ([#8614](#8614)) ([656d673](656d673))
* Add zones for rate limiting by `ip`, `user`, `session`, `global` ([#8508](#8508)) ([03fba97](03fba97))
* Allow `Parse.Object` pointers in Cloud Code arguments ([#8490](#8490)) ([28aeda3](28aeda3))

### Reverts

* fix: Inaccurate table total row count for PostgreSQL ([6722110](6722110))
@parseplatformorg
Copy link
Contributor

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

parseplatformorg pushed a commit that referenced this pull request Sep 16, 2023
# [6.3.0](6.2.2...6.3.0) (2023-09-16)

### Bug Fixes

* Cloud Code Trigger `afterSave` executes even if not set ([#8520](#8520)) ([afd0515](afd0515))
* GridFS file storage doesn't work with certain `enableSchemaHooks` settings ([#8467](#8467)) ([d4cda4b](d4cda4b))
* Inaccurate table total row count for PostgreSQL ([#8511](#8511)) ([0823a02](0823a02))
* LiveQuery server is not shut down properly when `handleShutdown` is called ([#8491](#8491)) ([967700b](967700b))
* Rate limit feature is incompatible with Node 14 ([#8578](#8578)) ([f911f2c](f911f2c))
* Unnecessary log entries by `extendSessionOnUse` ([#8562](#8562)) ([fd6a007](fd6a007))

### Features

* `extendSessionOnUse` to automatically renew Parse Sessions ([#8505](#8505)) ([6f885d3](6f885d3))
* Add new Parse Server option `preventSignupWithUnverifiedEmail` to prevent returning a user without session token on sign-up with unverified email address ([#8451](#8451)) ([82da308](82da308))
* Add option to change the log level of logs emitted by Cloud Functions ([#8530](#8530)) ([2caea31](2caea31))
* Add support for `$eq` query constraint in LiveQuery ([#8614](#8614)) ([656d673](656d673))
* Add zones for rate limiting by `ip`, `user`, `session`, `global` ([#8508](#8508)) ([03fba97](03fba97))
* Allow `Parse.Object` pointers in Cloud Code arguments ([#8490](#8490)) ([28aeda3](28aeda3))

### Reverts

* fix: Inaccurate table total row count for PostgreSQL ([6722110](6722110))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.3.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Sep 16, 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.

LiveQueryServer doesn't shutdown properly
5 participants