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: Add customTag parameter to the tunnelConnectResponded event #411

Merged
merged 5 commits into from
Mar 1, 2023

Conversation

jirimoravcik
Copy link
Member

@jirimoravcik jirimoravcik commented Feb 27, 2023

Also add tunnelConnectFailed event.

This is used to pass information that was passed by prepareRequestFunction back via events

@github-actions github-actions bot added this to the 58th sprint - Platform team milestone Feb 27, 2023
@github-actions github-actions bot added the t-platform Issues with this label are in the ownership of the platform team. label Feb 27, 2023
src/server.ts Outdated
@@ -73,6 +74,7 @@ export type PrepareRequestFunctionResult = {
localAddress?: string;
ipFamily?: number;
dnsLookup?: typeof dns['lookup'];
metadata?: Record<string, unknown>;
Copy link
Member

Choose a reason for hiding this comment

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

Please can you document this in readme?

Copy link
Member

Choose a reason for hiding this comment

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

btw does this need to be a dictionary? why not any object user-supplied object?

Copy link
Member

@fnesveda fnesveda left a comment

Choose a reason for hiding this comment

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

Agreed with Honza's points, plus it would be nice to have a test for these events, unless it would be too much work to add.

Otherwise it looks good 🙂

README.md Outdated

// Optional metadata that will be passed back via
// `tunnelConnectResponded` or `tunnelConnectFailed` events
metadata: { userId: '123' },
Copy link
Member

Choose a reason for hiding this comment

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

sorry, just one last note 🙈 wouldn't it make more sense to call this tag or customTag rather than metadata? metadata has a specific meaning. Your call @jirimoravcik

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, I went with customTag, smaller chance of a meaning conflict due to the name

@jirimoravcik jirimoravcik changed the title feat: Add metadata parameter to the tunnelConnectResponded event feat: Add customTag parameter to the tunnelConnectResponded event Mar 1, 2023
@jirimoravcik jirimoravcik merged commit 67b43c0 into master Mar 1, 2023
@jirimoravcik jirimoravcik deleted the feature/propagate-metadata-via-events branch March 1, 2023 12:19
@fnesveda fnesveda added the validated Issues that are resolved and their solutions fulfill the acceptance criteria. label Oct 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t-platform Issues with this label are in the ownership of the platform team. validated Issues that are resolved and their solutions fulfill the acceptance criteria.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants