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

don't broadcast state immediately onClose #75

Merged
merged 1 commit into from
Aug 9, 2024

Conversation

threepointone
Copy link
Collaborator

No description provided.

@threepointone threepointone force-pushed the delay-on-close-broadcast branch from d19f028 to b0253d4 Compare August 9, 2024 08:21
@@ -34,9 +34,9 @@ export class ChatRoom extends Server<Env> {
)
)

if (!this.ctx.storage.getAlarm()) {
if (!(await this.ctx.storage.getAlarm())) {
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

fml. this would have been caught with a lint rule. I'll work on adding a better lint setup soon.

// start the alarm to broadcast state every 30 seconds
this.ctx.storage.setAlarm(30000)
this.ctx.storage.setAlarm(Date.now() + 30000)
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

augh. maybe this should always accept only Dates, it's to oeasy to screw up.

@third774 third774 self-requested a review August 9, 2024 14:33
Copy link
Collaborator

@third774 third774 left a comment

Choose a reason for hiding this comment

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

Thank you!! 🙏🏻

@third774 third774 merged commit 2745709 into main Aug 9, 2024
2 checks passed
@third774 third774 deleted the delay-on-close-broadcast branch August 9, 2024 14:34
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