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

fix: use issue.node_id for permit nonces #108

Merged

Conversation

rndquu
Copy link
Member

@rndquu rndquu commented Aug 31, 2024

Resolves ubiquity-os/permit-generation#46

QA (development branch, old buggy behavior):
rndquu-org/my-repo-1#1 (comment): nonce=78893650957373058525222459826056873078870981337600027323707876018366845390587
rndquu-org/my-repo-2#1 (comment): nonce=78893650957373058525222459826056873078870981337600027323707876018366845390587

QA (fix/nonce-generation branch):
rndquu-org/my-repo-1#1 (comment): nonce=47174999346132534354494673705511461942918468951327270802916300108996236752932
rndquu-org/my-repo-2#1 (comment): nonce=83029153680898263555035957871388564685254995512260384748899620589901226451761

In the 1st case (QA for development branch) nonces are the same because issue number is used for nonce generation (not issue.id or issue.node_id). Hence 2 issues with the same issue number across 2 different repositories have equal nonces.

In the 2nd case (QA for fix/nonce-generation branch) we use issue.node_id for nonce generation which is different for any 2 repositories we take.

Notes:

  • Here here we still use issue number in order not to break saving permits (in particular saving data to the locations table). When we're about to remove the deprecated locations table then issue number related logic can be removed as well.
  • Tests are updated because nonce is calculated using issue.node_id instead of issue number hence permit URLs changed
  • Test timeout is increased because of this failing CI run (Exceeded timeout of 10000 ms for a test)

Copy link
Member

@0x4007 0x4007 left a comment

Choose a reason for hiding this comment

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

Let's always use latest. Otherwise looks good to me.

package.json Outdated Show resolved Hide resolved
@rndquu rndquu marked this pull request as ready for review September 9, 2024 15:30
package.json Outdated Show resolved Hide resolved
@rndquu rndquu merged commit 3f3ad8f into ubiquity-os-marketplace:development Sep 10, 2024
3 checks passed
@rndquu rndquu deleted the fix/nonce-generation branch September 10, 2024 06:59
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.

Duplicated nonces
3 participants