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

Possible error when not using proxydurable function to access class #13

Open
janat08 opened this issue Feb 1, 2022 · 3 comments
Open

Comments

@janat08
Copy link

janat08 commented Feb 1, 2022

I tested this a couple of weeks ago, so I don't remember if it's an issue. Simply accessing durable from request somehow fails, so you have to use the proxydurable export on environment variable for durable object binding.

@ambirex
Copy link

ambirex commented Feb 14, 2022

I think this might have something to do with itty-router because I noticed my own class (not DO) doesn't persist as an object; instead, I end up having to Object.assign(passedData, new MyClass())

I haven't wrapped my mind around all of the router's 30 some lines of code to figure out why that may be. (as in, I'm impressed with its brevity)

edit: sorry, didn't really the original close enough and sounded like something I found from the router.

@janat08
Copy link
Author

janat08 commented Feb 14, 2022

I think you’re writing about something else this is for when using do middlewear to bind classes to request, which returns undefined. I don’t think that assigning class to data is useful in a way that you think it is.

@kwhitley
Copy link
Owner

Definitely wouldn't/shouldn't be itty as the culprit (likely a break in my DO logic or perhaps a revision to how DO works in general, as this was developed shortly after they came out of beta last year)... but I need to dust this arm of development off anyway!

Thanks for the reminder - couple days of intense interviews this week, then I'll take a look and see if we can get this all sorted :)

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

No branches or pull requests

3 participants