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

Add support for sync proxy (node.js only) #5914

Merged
merged 15 commits into from
Jun 28, 2023
Merged

Add support for sync proxy (node.js only) #5914

merged 15 commits into from
Jun 28, 2023

Conversation

kneth
Copy link
Contributor

@kneth kneth commented Jun 20, 2023

What, How & Why?

This closes #5816

☑️ ToDos

  • 📝 Changelog entry
  • 📝 Compatibility label is updated or copied from previous entry
  • 📝 Update COMPATIBILITY.md
  • 🚦 Tests
  • 🔀 Executed flexible sync tests locally if modifying flexible sync
  • 📦 Updated internal package version in consuming package.jsons (if updating internal packages)
  • 📱 Check the React Native/other sample apps work if necessary
  • 📝 Public documentation PR created or is not necessary
  • 💥 Breaking label has been applied or is not necessary

If this PR adds or changes public API's:

  • typescript definitions file is updated
  • jsdoc files updated

@cla-bot cla-bot bot added the cla: yes label Jun 20, 2023
@kneth kneth self-assigned this Jun 20, 2023
@kneth kneth marked this pull request as ready for review June 21, 2023 14:23
@kneth kneth requested review from elle-j and takameyer June 21, 2023 14:23
@coveralls
Copy link

Coverage Status

coverage: 85.2% (-0.5%) from 85.659% when pulling 6c5a21f on kneth/http-proxy into db590ab on main.

Copy link
Contributor

@elle-j elle-j left a comment

Choose a reason for hiding this comment

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

Nice! 💪 I've got some minor suggestions and questions.

integration-tests/tests/src/node/sync-proxy.ts Outdated Show resolved Hide resolved
packages/realm/src/Realm.ts Outdated Show resolved Hide resolved
packages/realm/src/platform/node/sync-proxy-config.ts Outdated Show resolved Hide resolved
packages/realm/src/platform/node/sync-proxy-config.ts Outdated Show resolved Hide resolved
integration-tests/tests/src/node/sync-proxy.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@elle-j elle-j left a comment

Choose a reason for hiding this comment

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

LGTM, interesting PR!

integration-tests/tests/src/node/sync-proxy.ts Outdated Show resolved Hide resolved
Copy link
Contributor

@takameyer takameyer left a comment

Choose a reason for hiding this comment

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

LGTM. Any reason this is node only?

@kneth
Copy link
Contributor Author

kneth commented Jun 26, 2023

@takameyer asks

Any reason this is node only?

I haven't found a polyfill for fetch which brings HTTP proxies to React Native.


import { inject } from "../sync-proxy-config";

// simply returning `undefined` to signal that proxy settings should be silently ignored.
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we silently be ignoring this? I would like some sort of signal if I were trying to implementing this

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I would prefer to silently ignore it - and provide the proper fix by moving to platform networking when we have the time.

@@ -18,5 +18,6 @@

import "./fs";
import "./device-info";
import "./sync-proxy-config";
Copy link
Contributor

Choose a reason for hiding this comment

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

Should this be done in react-native as well?

Copy link
Contributor

Choose a reason for hiding this comment

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

Alternatively, we could just remove the react-native implementation and let it throw.

@kneth kneth force-pushed the kneth/http-proxy branch 2 times, most recently from 0fc56b7 to bec0639 Compare June 27, 2023 10:42
kneth and others added 11 commits June 28, 2023 12:21
@kneth kneth merged commit e3bef5a into main Jun 28, 2023
@kneth kneth deleted the kneth/http-proxy branch June 28, 2023 13:53
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add support for HTTP proxies (node/electron)
5 participants