Skip to content

invalid_type error on order field when moving events to sidebar or between someday lists #583

@tyler-dane

Description

@tyler-dane

Where did this happen?

Local code with an up-to-date main branch

Expected Behavior

When typing [META] + CTRL + UP/DOWN while a someday event form is open for an existing event, the event should change someday list locations.

Current Behavior

When typing [META] + CTRL + UP/DOWN while a someday event form is open for an existing event, there is a runtime error. When clicking out of the error, the event changes lists correctly.

bug-shortcut.mov
Uncaught runtime errors:
×
ERROR
[
  {
    "code": "invalid_type",
    "expected": "number",
    "received": "undefined",
    "path": [
      "order"
    ],
    "message": "Required"
  }
]
ZodError
    at get error (http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:186648:31)
    at ZodObject.parse (http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:186723:22)
    at validateSomedayEvent (http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:193427:89)
    at http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:193431:39
    at Array.map (<anonymous>)
    at validateSomedayEvents (http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:193431:26)
    at categorizeSomedayEvents (http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:192976:113)
    at http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:195992:97
    at recomputationWrapper (http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:152679:25)
    at memoized (http://localhost:9080/main.e71f008816265da88192.js?f78dac117d4a67839b59:152569:20)

Steps to Reproduce

Error case 1: Between Someday Lists

  1. Create a someday event in the This Week list
  2. Click it to open the form
  3. Type [META] + CTRL + DOWN to try to move it to the This Month list
  4. Notice: error

Error case 2: Grid -> Sidebar

  1. Create a timed event (all day or timed)
  2. Type [META] + SHIFT + , or click the < icon in the form to try to send it to the sidebar
  3. Notice: error

Error case 3: Migrating Weeks

  1. Create a someday event (Month or week)
  2. Click it to open the form
  3. Type [META] + CTRL + [LEFT/RIGHT ARROW] to migrate it one week/month
  4. Notice: error

Success case:

  1. Click the Plus icon in the This Week list to create a draft (but don't save it yet)
  2. Type [META] + CTRL + DOWN to try to move it to the This Month list
  3. Notice: no error

Possible Solution

Likely related to #551 and #575

Context

This is a jarring experience that makes users reluctant to use shortcuts, especially those that don't understand that the runtime error doesn't actually affect their data.

Metadata

Metadata

Assignees

Labels

webFrontend/web related issue

Type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions