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

In-Memory Durable Objects #391

Merged
merged 3 commits into from
Sep 27, 2022
Merged

In-Memory Durable Objects #391

merged 3 commits into from
Sep 27, 2022

Conversation

mrbbot
Copy link
Contributor

@mrbbot mrbbot commented Sep 26, 2022

This PR adds support for non-durable Durable Objects. The open-source runtime does not yet support persisted objects. Data is lost when calling setOptions() or restarting. Closes #366.

@mrbbot mrbbot added this to the 3.0.0 milestone Sep 26, 2022
@mrbbot mrbbot requested a review from penalosa September 26, 2022 13:26
@cloudflare-workers-and-pages
Copy link

Deploying with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4df6f54
Status: ✅  Deploy successful!
Preview URL: https://d98ab532.cf-miniflare.pages.dev
Branch Preview URL: https://tre-durable-objects.cf-miniflare.pages.dev

View logs

Copy link
Contributor

@penalosa penalosa left a comment

Choose a reason for hiding this comment

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

Couple changes, but otherwise looks good

packages/tre/src/index.ts Show resolved Hide resolved
packages/tre/src/index.ts Outdated Show resolved Hide resolved
(now.getMonth() + 1).toString().padStart(2, "0"),
now.getDate().toString().padStart(2, "0"),
].join("-");
const FALLBACK_COMPATIBILITY_DATE = "2000-01-01";
Copy link
Contributor

Choose a reason for hiding this comment

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

Why are we shifting from today to a compat date of 2000? Surely keeping it up to date would be better?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The runtime has a maximum compatibility date it supports, which may lag behind the current date by a few days. If we specify a date after this, it will throw an error. I think the default compatibility date (at least for Miniflare) should be fixed in the past too, and shouldn't depend on the current time.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sure, that makes sense. Do we not want something slightly more recent than 2000 though?

Copy link
Contributor

Choose a reason for hiding this comment

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

At least after the last behaviour change, which looks like it was 2022-08-04 https://developers.cloudflare.com/workers/platform/compatibility-dates/

packages/tre/src/plugins/do/index.ts Outdated Show resolved Hide resolved
packages/tre/src/plugins/kv/index.ts Show resolved Hide resolved
@mrbbot mrbbot merged commit 4f15e08 into tre Sep 27, 2022
@mrbbot mrbbot deleted the tre-durable-objects branch September 27, 2022 12:19
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