agrc / forklift

:tractor::package::sparkles: Slinging data all over the place :tractor::package::sparkles:
MIT License
28 stars 3 forks source link

During ship, crates do not have the correct values set for `was_updated` & `result` #293

Closed stdavis closed 5 years ago

stdavis commented 5 years ago

Steps to reproduce

  1. Lift a pallet with at least one crate that updates.
  2. Verify that the packing slip shows the correct values for result and was_updated.
  3. Ship and inspect the values after the pallets have been built.

Expected behavior

crate.was_updated() => True crate.result => "Data updated successfully."

Actual behavior

crate.was_updated() => False crate.result => "This crate was never processed."

This causes problems for Pallets that want to act only if crates were updated during lift. For example: https://github.com/agrc/warehouse/blob/master/sgid/AGOLPallet.py#L71

A possible fix would be to expand Pallet.add_packing_slip to loop through all of the crates in the slip and update these properties (are there any others?) of the actual crates. Here is where that method is called in engine.py.

This is causing the AGOL pallet to not update data in AGOL since it never has updated crates during ship.