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

fix email info declaration #289

Merged
merged 1 commit into from
Jan 19, 2023
Merged

fix email info declaration #289

merged 1 commit into from
Jan 19, 2023

Conversation

edevil
Copy link
Contributor

@edevil edevil commented Jan 19, 2023

EmailInfo attributes were incorrectly declared which prevented them from being serialized into the trace event.

EmailInfo attributes were incorrectly declared which
prevented them from being serialized into the trace event.
JSG_READONLY_PROTOTYPE_PROPERTY(rawSize, getRawSize);
JSG_READONLY_INSTANCE_PROPERTY(mailFrom, getMailFrom);
JSG_READONLY_INSTANCE_PROPERTY(rcptTo, getRcptTo);
JSG_READONLY_INSTANCE_PROPERTY(rawSize, getRawSize);
Copy link
Member

Choose a reason for hiding this comment

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

Is this because the structure is JSON stringified? If so, a better long term solution here is to implement a toJSON method. This change is good for now but let me explore the toJSON approach separately

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That is correct. This Event object will be JSON.stringified() by the Tracer in edgeworker.

Copy link
Member

Choose a reason for hiding this comment

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

ok yeah, I'll work up a generic toJSON mechanism that will make this easier. In general the reason we want to avoid JSG_*_INSTANCE_PROPERTY is that it forces the objects to stay alive longer than they otherwise need to be rather than being gc'd earlier.

@edevil edevil merged commit 8bbb14a into main Jan 19, 2023
@edevil edevil deleted the fix_email_info branch January 19, 2023 20:36
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