MarcKaufmann / congame

The best experimental economics software built in Racket
20 stars 5 forks source link

`user-manager-verify` contract error #109

Closed MarcKaufmann closed 2 years ago

MarcKaufmann commented 2 years ago

It looks like the id of a user can be 0, yet the contract assumes it cannot be, or at least that is my interpretation of what went wrong here. Except, I don't see any user with identity 0 in the database, so I am baffled how this could have happened... @Bogdanp: Any ideas? We'll see if I hit it again.

[2022-02-09 10:06:26.356] [ 9] [ debug] system: starting system [2022-02-09 10:06:26.356] [ 9] [ debug] system: starting component sessions [2022-02-09 10:06:26.356] [ 9] [ debug] system: starting component db [2022-02-09 10:06:26.356] [ 9] [ debug] system: starting component hasher [2022-02-09 10:06:26.356] [ 9] [ debug] system: starting component users [2022-02-09 10:06:26.356] [ 9] [ debug] system: starting component auth [2022-02-09 10:06:26.356] [ 9] [ debug] system: starting component broker [2022-02-09 10:06:26.663] [ 9] [ debug] system: starting component flashes [2022-02-09 10:06:26.663] [ 9] [ debug] system: starting component mailer [2022-02-09 10:06:26.663] [ 9] [ debug] system: starting component migrator [2022-02-09 10:06:26.738] [ 9] [ debug] north-adapter: creating schema table [2022-02-09 10:06:26.740] [ 9] [ debug] system: starting component app [2022-02-09 10:06:26.740] [ 9] [ debug] system: starting component server [2022-02-09 10:06:26.740] [ 9] [ info] server: listening on 0.0.0.0:9100 [2022-02-09 10:06:26.740] [ 9] [ debug] system: starting component worker [2022-02-09 10:06:26.744] [ 9] [ debug] system: starting component mail-server user-manager-verify!: contract violation expected: exact-positive-integer? given: 0 in: the 2nd argument of (-> user-manager? exact-positive-integer? string? void?) contract from: (function user-manager-verify!) blaming: #%embedded:congame-identity/components/user: (assuming the contract is correct) at: /congame-identity/components/user.rkt:157.18 context...: .../private/blame.rkt:346:0: raise-blame-error .../private/arrow-higher-order.rkt:375:33 .../pages/auth.rkt:132:0 .../private/arrow-higher-order.rkt:375:33 [repeats 4 more times] .../koyo/profiler.rkt:116:16: f .../private/arrow-higher-order.rkt:375:33 .../koyo/profiler.rkt:116:16: f .../private/arrow-higher-order.rkt:375:33 [repeats 1 more time] .../koyo/profiler.rkt:116:16: f .../private/arrow-higher-order.rkt:375:33 [repeats 3 more times] .../dispatchers/dispatch-servlets.rkt:63:2 .../private/more-scheme.rkt:163:2: select-handler/no-breaks .../private/dispatch-server-with-connect-unit.rkt:101:2 https://staging.totalinsightmanagement.com//api/v1/study-participants-with-identity;((%22k%22%20.%20%22(4%201%2025202213)%22))

MarcKaufmann commented 2 years ago

The contract is right, it is not clear how this error occurred. It might have happened by accident providing the wrong id in the verification url, but it does not appear in my history.