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

use Symbol.for instead of Symbol ctor #375

Merged
merged 1 commit into from
Apr 10, 2024
Merged

use Symbol.for instead of Symbol ctor #375

merged 1 commit into from
Apr 10, 2024

Conversation

devhawk
Copy link
Collaborator

@devhawk devhawk commented Apr 10, 2024

I was debuging Transact using one of our demo apps. Because I was running Transact from the repo against a demo app w/ it's own version of Transact, it couldn't locate any of the handler endpoints. Because I was using two different copies of Transact, I ended up with two different sets of metadata key symbols:

const paramMetadataKey = Symbol("dbos:parameter");
const methodMetadataKey = Symbol("dbos:method");
const classMetadataKey = Symbol("dbos:class");

This PR switches these symbols from using Symbol's constructor to using Symbol.for.

Symbol('bar') !== Symbol('bar');
Symbol.for('bar') === Symbol.for('bar');

Copy link
Contributor

@maxdml maxdml left a comment

Choose a reason for hiding this comment

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

@devhawk devhawk merged commit 19c9786 into main Apr 10, 2024
2 checks passed
@devhawk devhawk deleted the devhawk/symbol-for branch April 10, 2024 16:13
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.

None yet

2 participants