Back

Getting Error 400, when trying to update document if enum is marked required

  • 0
  • Databases
Vedsaga
28 Jul, 2023, 07:37

I have created the document and trying to update it.

I am getting error

TypeScript
"Invalid document structure: Attribute "gatePassStatus" has invalid format. Value must be one of (in-progress, dispatched, comple…"

as I I am trying to update so isn't this field should be optional ? As, I passed this anyway during document creation...

TL;DR
The user is experiencing an error (Error 400) when trying to update a document if an enum attribute is marked as required. They tried to reproduce the error but were unsuccessful. The user provided the steps they took, but it is still unclear why the issue is occurring. The user mentioned that if the enum attribute is the last attribute and marked as required, the error is thrown. They also mentioned that only one of the two enum attributes is being asked to pass, even though both should be required. It was discovered that the bug is related to the last created enum attribute. The user is still experiencing the error and is unsure why the
Drake
28 Jul, 2023, 08:01

Is the value no longer a possible enum?

Vedsaga
28 Jul, 2023, 08:02

it is still enum

Vedsaga
28 Jul, 2023, 08:02
Drake
28 Jul, 2023, 08:02

I mean what are the possible values and what is the current value in the document?

Vedsaga
28 Jul, 2023, 08:02

these are possible enums

Vedsaga
28 Jul, 2023, 08:03

and this is the value

Vedsaga
28 Jul, 2023, 08:04

btw, after passing the enum it seems to work normaly doc is getting updated... but wired part is out of two enum only getting asked to pass gatePassStatus enum only and it's not asking to pass entryReason

Drake
28 Jul, 2023, 08:05

Weird...

Vedsaga
28 Jul, 2023, 08:06

ok, found the bug... so, if the enum is last then it only ask for last

Vedsaga
28 Jul, 2023, 08:06
Vedsaga
28 Jul, 2023, 08:06

I just added then enum and now it's only asking for test enum to pass

Vedsaga
28 Jul, 2023, 08:07

so, if last created attribute is enum & marked as required then it's throw error

Drake
28 Jul, 2023, 17:42

i can't seem to reproduce the problem. can you give exact steps?

Vedsaga
29 Jul, 2023, 05:52

I guess steps were,

  1. I create a collection two 3 attributes on of them was enum
  2. Then I deleted the enum attribute and created again ( when mean now this enum is last attrbuties appears in the console)
  3. Then I create a document
  4. Then, I treid to update the doc making sure that Doc securrity is eanbled and user is logged ined
Vedsaga
29 Jul, 2023, 06:14

version is 1.3.7

Drake
29 Jul, 2023, 14:59

You can run these exact steps on a new collection and reproduce the error?

Vedsaga
29 Jul, 2023, 15:04

umm, no for some reason it not happening if just created from scratch DB πŸ‘€

Drake
29 Jul, 2023, 15:15

We need reproducible steps πŸ˜•

Vedsaga
29 Jul, 2023, 15:15

don't know why it was happening it seems very very wired

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more