Skip to content
This repository was archived by the owner on Sep 21, 2023. It is now read-only.

Conversation

@link2xt
Copy link
Contributor

@link2xt link2xt commented Jun 4, 2023

Previously import on an unconfigured bot stored incomplete config in the database
and the bot did not start afterwards. See my comment at #26 (comment)

I have now changed increase_get_serial() not to store the serial at all, so until the bot is started the serial virtually stays at "1".

The test check that it is possible to run import with example apps, then start the bot and receive a list of 4 apps.

The PR consists of two commits with descriptions, please don't squash. #26 was also not supposed to be squashed btw. Ideally just let me merge my own PRs.

@link2xt link2xt requested a review from Septias June 4, 2023 19:15
link2xt added 2 commits June 4, 2023 19:28
`increase_get_serial()` is called when `import` CLI command is used.
If the bot is not configured, previously it stored an incomplete
config with only the `serial` field. Such bot config cannot
be deserialized into `BotConfig` structure afterwards.

The function is changed not to store the serial and always return 1
until the bot is started at least once and users get a chance
to receive an update.
@link2xt link2xt force-pushed the link2xt/run-after-import branch from 51d3534 to 0d3442b Compare June 4, 2023 19:29
@link2xt link2xt merged commit 0d3442b into main Jun 4, 2023
@link2xt link2xt deleted the link2xt/run-after-import branch June 4, 2023 19:29
@link2xt link2xt mentioned this pull request Jun 7, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants