Skip to content

Conversation

@stelar7
Copy link
Contributor

@stelar7 stelar7 commented May 22, 2025

Some work towards fixing the issues mentioned in #433

The following tasks have been completed:

  • Confirmed there are no ReSpec/BikeShed errors or warnings.
  • Modified Web platform tests (link to pull request)

Implementation commitment:


Preview | Diff

@stelar7 stelar7 force-pushed the database-upgrade-adjustment branch from 4352ded to 11bb776 Compare May 22, 2025 09:43
return a newly [=exception/created=]
"{{AbortError}}" {{DOMException}} and abort these steps.

1. If the [=/upgrade transaction=] was aborted, run the steps
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think you need to return a value from upgrade a database as the request's transaction will be set to the transaction, although only if it succeeded. If it was aborted, the request's transaction will be null and done flag will be false. So this can change to something like "If |request|'s [=request/transaction=] is null, run the steps to..."

Copy link
Member

Choose a reason for hiding this comment

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

Thanks for this analysis, @evanstade. Agreed - I think this recommendation is sufficient. Even easier than what I recommended over in #433 (comment)

Copy link
Contributor Author

@stelar7 stelar7 May 30, 2025

Choose a reason for hiding this comment

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

I might be wrong here, but I dont think thats correct. The upgrade transaction has to finish before we can stop spinning during upgrade. As mentioned, aborting will clear the transaction, but as part of commiting, the requests transaction is also cleared (since we are an upgrade transaction). This means that at this point, |request|'s [=request/transaction=] should be null in all cases?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Good find @stelar7! Upgrade transaction completion does indeed reset the request's transaction to null. The web platform tests also verify this behavior.

Going back to the drawing board, maybe another potential alternative involves using the request's error, which the abort sets?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is there some reason we dont want to have the return? (what i feel is the simple solution)

Copy link
Contributor

Choose a reason for hiding this comment

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

Good catch @stelar7.

I like Steve's idea.

Is there some reason we dont want to have the return?

In general it seems preferable to work with the state that is already available, rather than making more state available to more of the system (especially when it is redundant). Returning the transaction changes its lifetime. There are fewer hypothetical side effects to reading state that already exists in the request.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Updated to use the requests error 👍

@stelar7 stelar7 force-pushed the database-upgrade-adjustment branch from aa3cdef to 4990023 Compare August 6, 2025 07:23
@SteveBeckerMSFT SteveBeckerMSFT changed the title Return transaction from upgrade a database Check the upgrade request's error instead of the upgrade transaction Aug 11, 2025
@SteveBeckerMSFT SteveBeckerMSFT merged commit f0a1064 into w3c:main Aug 11, 2025
2 checks passed
github-actions bot added a commit that referenced this pull request Aug 11, 2025
…458)

SHA: f0a1064
Reason: push, by SteveBeckerMSFT

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
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.

4 participants