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

Subscription cursor is not actually being saved #49

Open
mackuba opened this issue Jun 28, 2023 · 2 comments
Open

Subscription cursor is not actually being saved #49

mackuba opened this issue Jun 28, 2023 · 2 comments

Comments

@mackuba
Copy link
Contributor

mackuba commented Jun 28, 2023

There is a problem in the FirehoseSubscriptionBase implementation of updateCursor(). It makes an update to the sub_state table to put the current cursor state there, but since no one has inserted any rows there previously, the update doesn't do anything.

The method should either first make a select and then either insert or update, or some kind of "insert / on conflict" (but there would need to be a unique index), or insert a null row there at launch. I don't know how you'd prefer to fix this, so I'm leaving this an an issue w/o a PR.

@benharri
Copy link
Contributor

i fixed it in mine with this commit adabfbb

@mackuba
Copy link
Contributor Author

mackuba commented Jun 29, 2023

I had one more thought about this while adding this feature to my code now - I think it would be good to keep it optional and not on by default in development mode, only turn it on when deployed in production.

In development on a local machine, it will be normal to have the script running for some time and then not running when the developer is not working on it. So if they turn it on e.g. in the morning and kill the script and then restart it again in the evening, they would suddenly get a whole day's worth of events to process…

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

2 participants