OpenFn / lightning

OpenFn/Lightning ⚡️ is the newest version of the OpenFn DPG and provides a web UI to visually manage complex workflow automation projects.
https://openfn.github.io/lightning/
GNU Lesser General Public License v3.0
131 stars 36 forks source link

Collections: error in put_all #2680

Open sentry-io[bot] opened 2 hours ago

sentry-io[bot] commented 2 hours ago

Sentry Issue: LIGHTNING-P1

FunctionClauseError: no function clause matching in anonymous fn/2 in Lightning.Collections.put_all/2
  File "lib/lightning/collections.ex", line 167, in anonymous fn/2 in Lightning.Collections.put_all/2
  File "lib/enum.ex", line 4798, in Enum.with_index_list/3
  File "lib/lightning/collections.ex", line 167, in Lightning.Collections.put_all/2
  File "lib/lightning_web/controllers/collections_controller.ex", line 51, in LightningWeb.CollectionsController.put_all/2
  File "lib/lightning_web/controllers/collections_controller.ex", line 1, in LightningWeb.CollectionsController.action/2
...
(3 additional frame(s) were not displayed)
stuartc commented 2 hours ago

@josephjclark I think it's because the item is missing a key..

josephjclark commented 1 hour ago

@stuartc Oh, you're right!

josephjclark commented 1 hour ago

@stuartc this must be user error then: they've returned null or something from the keygen function.

I'll raise an issue for the adaptor to throw in this case.

Maybe the endpoint needs to return a 500 or something?

josephjclark commented 1 hour ago

Or maybe the endpoint returns 200, inserts the items it can, and rejects the ones it cannot