Skip to content
This repository was archived by the owner on Sep 11, 2025. It is now read-only.

Arrays in collections host functions should be non-nil#384

Merged
jairad26 merged 4 commits intomainfrom
as-nil-labels-bug
Sep 25, 2024
Merged

Arrays in collections host functions should be non-nil#384
jairad26 merged 4 commits intomainfrom
as-nil-labels-bug

Conversation

@jairad26
Copy link
Contributor

@jairad26 jairad26 commented Sep 25, 2024

HYP-2258
assemblyscript collections sdk is reporting this error on search:
"error":"failed to write array item: unexpected nil value for non-nullable type
This is because labels slices are nullable in golang, but assemblyscript arrays are non nullable. To fix this, we're catching all nil arrays and returning that as empty arrays in the collection host functions

@jairad26 jairad26 requested a review from a team September 25, 2024 20:36
@jairad26 jairad26 changed the title catch nil labels and output as empty in collections HYP-2258 catch nil labels and output as empty in collections Sep 25, 2024
@linear
Copy link

linear bot commented Sep 25, 2024

HYP-2258 SearchCollections in functions-as returns error on empty labels

"error":"failed to write array item: unexpected nil value for non-nullable type"

@jairad26 jairad26 enabled auto-merge (squash) September 25, 2024 20:44
@jairad26 jairad26 changed the title HYP-2258 catch nil labels and output as empty in collections HYP-2258 Arrays in collections host functions should be non-nil Sep 25, 2024
@mattjohnsonpint mattjohnsonpint changed the title HYP-2258 Arrays in collections host functions should be non-nil Arrays in collections host functions should be non-nil Sep 25, 2024
@jairad26 jairad26 merged commit 2b982b9 into main Sep 25, 2024
@jairad26 jairad26 deleted the as-nil-labels-bug branch September 25, 2024 21:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants