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

Remove crypto from OSDK #1051

Merged
merged 4 commits into from
Dec 11, 2024
Merged

Remove crypto from OSDK #1051

merged 4 commits into from
Dec 11, 2024

Conversation

nihalbhatnagar
Copy link
Contributor

React-native has issues with dependencies on crypto. Removes our polyfill and usage in object set watcher. Also fixes a small bug that can cause issues with unsubscribing with multiple subscriptions

@@ -275,18 +274,7 @@ export class ObjectSetListenerWebsocket {
// so we filter those out.
const readySubs = [...this.#subscriptions.values()].filter(isReady);

if (readySubs.length === 0) {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is not the behavior we want. We want to update that we have no more subscriptions so that we don't unnecessarily take up space over the wire

@@ -572,6 +565,7 @@ export class ObjectSetListenerWebsocket {

#handleMessage_subscriptionClosed(payload: SubscriptionClosed) {
const sub = this.#subscriptions.get(payload.id);
if (sub == null && this.#endedSubscriptions.has(payload.id)) return;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Subscription is deleted in unsubscribe

ericanderson
ericanderson previously approved these changes Dec 10, 2024
@policy-bot policy-bot bot dismissed ericanderson’s stale review December 10, 2024 20:23

Invalidated by push of ee04cb7

@@ -188,7 +188,7 @@ describe("ObjectSetListenerWebsocket", async () => {
listener,
);

subReq1 = await expectSingleSubscribeMessage(ws);
subReq1 = await expectSubscribeMessages(ws, 2);
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Empty subscribe messages are now sent

@nihalbhatnagar nihalbhatnagar merged commit a7a4aef into main Dec 11, 2024
8 checks passed
@nihalbhatnagar nihalbhatnagar deleted the nihalb/remove-crypto branch December 11, 2024 15:37
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