Lag in updating page version number v2 Confluence REST API

Hi all,
I have a script that updates a specific page and then can turn around and update the page a second time right after the previous update. The script grabs the current page’s version number each time an update is about to occur to have the most recent version. I have noticed a lag on Confluence’s side in updating the page’s version number. This causes a 409 error for the second update, because it will try to post with an invalid version. Does the version number update occur after the response is sent?

Has anyone else experienced this?
Thanks

Hello @MyaHauck

The version number update occurs after the page is updated, and that update may take time. The response from the REST API is only telling you that the request was valid and the page update has been successfully submitted for execution.

It sounds like after the first update to the page, your script doesn’t check to ensure the page version number has increased FIRST before trying to update the page the second time.

:wave: @MyaHauck Thank you for the question and @sunnyape - agreed, this is what is happening. Thank you for the response!