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

gitbutler-feeds #5637

Merged
merged 8 commits into from
Nov 22, 2024
Merged

gitbutler-feeds #5637

merged 8 commits into from
Nov 22, 2024

Conversation

Caleb-T-Owens
Copy link
Contributor

@Caleb-T-Owens Caleb-T-Owens commented Nov 20, 2024


This is part 2 of 2 in a stack made with GitButler:

@Caleb-T-Owens Caleb-T-Owens mentioned this pull request Nov 20, 2024
Copy link

vercel bot commented Nov 20, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
gitbutler-components ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 3:25pm
gitbutler-web ✅ Ready (Inspect) Visit Preview 💬 Add feedback Nov 22, 2024 3:25pm

Base automatically changed from Install-redux to master November 21, 2024 18:30
@vercel vercel bot temporarily deployed to Preview – gitbutler-web November 21, 2024 19:51 Inactive
@Caleb-T-Owens Caleb-T-Owens marked this pull request as ready for review November 21, 2024 19:54
} as Subscription<Arguments>;
}

this.subscriptions.push(subscription);
Copy link
Contributor

Choose a reason for hiding this comment

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

When a previous subscription was found on lines 21:23 this line will push a duplicate. Maybe move this to line 32?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, this is indeed a subtle problem


subscription.interval = setInterval(() => {
subscription.lastCalled = Date.now();
callback();
Copy link
Contributor

Choose a reason for hiding this comment

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

The interval is meant to be shared by concurrent subscribers right? The callback argument to this function is ignored unless subscription.counter === 0.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If the arguments are the same, then the callback should also be the same definition.

That is however implicit and not enforced. I'll think about how to restructure this in such a way that it's certain that we have just one callback per subscription.

lastCalled: number;
}

export class InterestStore<Arguments> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we get a description for this class? I'm also curious if there might be a more descriptive name you can give this. Even after becoming familiar with the code I still get a bit confused when I see something.createInterest(...).

@Caleb-T-Owens Caleb-T-Owens merged commit fa6c39c into master Nov 22, 2024
16 checks passed
@Caleb-T-Owens Caleb-T-Owens deleted the gitbutler-feeds branch November 22, 2024 15:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants