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

[AERIE-1912] temporal object types don't transfer to worker #226

Merged
merged 4 commits into from Jun 28, 2022

Conversation

dyst5422
Copy link
Contributor

  • Tickets addressed: AERIE-1912
  • Review: By commit
  • Merge strategy: Merge (no squash)

Description

So because Temporal isn't yet into the spec, its not part of the structuredClone algorithm that is used when transferring data between workers (not sure if it ever will be in the structuredClone, but I would expect it to find its way in there when its formally brought into the spec).

The solution here is to serialize the Temporal objects before sending across to the worker, and deserialize on the worker.

I added two functions - one to serialize the Temporal objects in an object tree, and another to deserialize an object tree with Temporal objects.

Verification

There is the test added in the first commit for regression testing our worker, and a test with the change to actually test the serializer/deserializer.

Documentation

No documentation update needed

Future work

Add a test for durations/instants that are part of the attributes of an activity

@dyst5422 dyst5422 changed the title [AERIE-1912] temporal object types dont transfer [AERIE-1912] temporal object types don't transfer to worker Jun 16, 2022
@dyst5422 dyst5422 force-pushed the fix/AERIE-1912--temporal-object-types-dont-transfer branch from b561c7b to 7c91833 Compare June 23, 2022 16:29
@dyst5422
Copy link
Contributor Author

Rewrote the commit history to be clearer (there were some parts split between commits)

Copy link
Contributor

@pranav-super pranav-super left a comment

Choose a reason for hiding this comment

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

Makes sense!

@dyst5422 dyst5422 force-pushed the fix/AERIE-1912--temporal-object-types-dont-transfer branch 3 times, most recently from 3533da2 to 4d3a46f Compare June 24, 2022 17:53
Move the test utilities around a bit for clarity
Add regression test for time serialization
The function findAndOrderCommandArguments in CommandEDSLPreface.ts is
used in the generated code, but not in any code at compile time, so we
need to add a comment so typescript knows to ignore that it
@dyst5422 dyst5422 force-pushed the fix/AERIE-1912--temporal-object-types-dont-transfer branch from 4d3a46f to 59c9cac Compare June 28, 2022 16:18
@dyst5422 dyst5422 merged commit ed4468a into develop Jun 28, 2022
@dyst5422 dyst5422 deleted the fix/AERIE-1912--temporal-object-types-dont-transfer branch June 28, 2022 16:31
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

4 participants