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

feat(subscriptions): add heartbeat for WS subs #3740

Merged
merged 4 commits into from
Jan 23, 2024

Conversation

ThatOneBro
Copy link
Member

@ThatOneBro ThatOneBro commented Jan 17, 2024

TODO:

  • Add tests for heartbeat functionality

Copy link

vercel bot commented Jan 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Ignored Deployments
Name Status Preview Comments Updated (UTC)
medplum-app ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2024 1:19am
medplum-storybook ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2024 1:19am
medplum-www ⬜️ Ignored (Inspect) Visit Preview Jan 23, 2024 1:19am

Copy link

github-actions bot commented Jan 18, 2024

Messages
📖 @medplum/core: 153.9 kB
📖 @medplum/react: 337.0 kB

Generated by 🚫 dangerJS against 5a29ce9

@ThatOneBro ThatOneBro force-pushed the derrick-add-heartbeat-ws-subs branch 2 times, most recently from 325106c to 90b50c5 Compare January 19, 2024 01:42
@@ -42,7 +42,7 @@ export interface MedplumSourceInfraConfig {
maxAzs: ValueOrExternalSecret<number>;
rdsInstances: ValueOrExternalSecret<number>;
rdsInstanceType: ValueOrExternalSecret<string>;
rdsInstanceVersion: ValueOrExternalSecret<string>;
rdsInstanceVersion?: ValueOrExternalSecret<string>;
Copy link
Member Author

Choose a reason for hiding this comment

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

It seems like this is intended to be optional, this was causing a type error in the tests since it was marked as required, though in the MedplumInfraConfig it is treated as optional

Copy link
Member

Choose a reason for hiding this comment

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

Nice, good catch

packages/server/src/config.ts Outdated Show resolved Hide resolved
Copy link
Member

@codyebberson codyebberson left a comment

Choose a reason for hiding this comment

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

Nice, lgtm 👍

Nothing blocking, but a handful of comments for your consideration

@@ -42,7 +42,7 @@ export interface MedplumSourceInfraConfig {
maxAzs: ValueOrExternalSecret<number>;
rdsInstances: ValueOrExternalSecret<number>;
rdsInstanceType: ValueOrExternalSecret<string>;
rdsInstanceVersion: ValueOrExternalSecret<string>;
rdsInstanceVersion?: ValueOrExternalSecret<string>;
Copy link
Member

Choose a reason for hiding this comment

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

Nice, good catch

packages/server/src/app.ts Outdated Show resolved Hide resolved
packages/server/src/config.ts Outdated Show resolved Hide resolved
heartbeat: { type: 'heartbeat' };
};

export const heartbeat = new TypedEventTarget<HeartbeatEventMap>();
Copy link
Member

Choose a reason for hiding this comment

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

Separate conversation, out of scope for this PR, but I wonder if we could combine TypedEventTarget and EventTarget into a single class to avoid the wrapping. Not a big deal, we can discuss offline.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably could, shouldn't be an issue

Copy link

sonarcloud bot commented Jan 23, 2024

@ThatOneBro ThatOneBro added this pull request to the merge queue Jan 23, 2024
Merged via the queue into main with commit f38c6b8 Jan 23, 2024
20 checks passed
@ThatOneBro ThatOneBro deleted the derrick-add-heartbeat-ws-subs branch January 23, 2024 02:20
medplumbot added a commit that referenced this pull request Jan 31, 2024
Fixes #3794 - MeasureReport.period search (#3850)
Extra check for vmcontext bots (#3863)
Add and use vite-plugin-turbosnap (#3849)
Downgrade chromatic (#3848)
Repo sql fixes for cockroachdb (#3844)
Remove Health Gorilla from medplum-demo-bots (#3845)
fix-3815 cache presigned s3 binary urls (#3834)
Use tsvector index for token text search (#3791)
rate limit should return `OperationOutcome` (#3843)
Add global var "module" to vm context bots (#3842)
Fix lookup table tsv indexes (#3841)
Always use estimate count first (#3840)
Disambiguate getClient (#3839)
Fix invalid mermaid graph in diagnostic catalog docs (#3836)
fix-3809 race condition in Subscription extension fhir-path-criteria-expression %previous value lookup (#3810)
Fix Sonar code smells: mark React props readonly (#3832)
RDS proxy (#3827)
Fixed lookup tables in migration generator (#3830)
Fixed deprecated jest matchers (#3831)
Update README.md (#3828)
Update fhir-basics.md (#3829)
Case study content and images (#3820)
Added rdsReaderInstanceType and RDS upgrade docs (#3826)
Dependency upgrades (#3825)
Separate search popup menus for 'text' and 'token' (#3824)
Improve performance of token sort (#3823)
Additional logging (#3790)
Fix calendar input button style (#3817)
Don't add _total default in SearchControl (#3818)
Dark mode (#3814)
Fixes #3812 - FHIR profile cache bug (#3813)
Document using medplum client to integrate with external FHIR servers (#3811)
Use specific advisory locks (#3805)
Nested transactions (#3788)
Fix signin page on graphiql (#3802)
fix(heartbeat): start heartbeat on first bind to sub (#3793)
Fix async job tests (#3795)
Document using vm context bots (#3784)
Refactored access policy docs based on customer feedback (#3785)
Support Redis TLS config from Env (#3787)
feat(subscriptions): add `heartbeat` for WS subs (#3740)
Update Bot metrics (#3763)
github-merge-queue bot pushed a commit that referenced this pull request Jan 31, 2024
Fixes #3794 - MeasureReport.period search (#3850)
Extra check for vmcontext bots (#3863)
Add and use vite-plugin-turbosnap (#3849)
Downgrade chromatic (#3848)
Repo sql fixes for cockroachdb (#3844)
Remove Health Gorilla from medplum-demo-bots (#3845)
fix-3815 cache presigned s3 binary urls (#3834)
Use tsvector index for token text search (#3791)
rate limit should return `OperationOutcome` (#3843)
Add global var "module" to vm context bots (#3842)
Fix lookup table tsv indexes (#3841)
Always use estimate count first (#3840)
Disambiguate getClient (#3839)
Fix invalid mermaid graph in diagnostic catalog docs (#3836)
fix-3809 race condition in Subscription extension fhir-path-criteria-expression %previous value lookup (#3810)
Fix Sonar code smells: mark React props readonly (#3832)
RDS proxy (#3827)
Fixed lookup tables in migration generator (#3830)
Fixed deprecated jest matchers (#3831)
Update README.md (#3828)
Update fhir-basics.md (#3829)
Case study content and images (#3820)
Added rdsReaderInstanceType and RDS upgrade docs (#3826)
Dependency upgrades (#3825)
Separate search popup menus for 'text' and 'token' (#3824)
Improve performance of token sort (#3823)
Additional logging (#3790)
Fix calendar input button style (#3817)
Don't add _total default in SearchControl (#3818)
Dark mode (#3814)
Fixes #3812 - FHIR profile cache bug (#3813)
Document using medplum client to integrate with external FHIR servers (#3811)
Use specific advisory locks (#3805)
Nested transactions (#3788)
Fix signin page on graphiql (#3802)
fix(heartbeat): start heartbeat on first bind to sub (#3793)
Fix async job tests (#3795)
Document using vm context bots (#3784)
Refactored access policy docs based on customer feedback (#3785)
Support Redis TLS config from Env (#3787)
feat(subscriptions): add `heartbeat` for WS subs (#3740)
Update Bot metrics (#3763)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
subscriptions Features and fixes related to subscriptions
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

2 participants