Skip to content

Refuse to save if the report will overwrite a non-report object #20

@MrCreosote

Description

@MrCreosote

App devs have encountered an issue where they supply the same name to the report object and the data object, leading the data object to be overwritten (but saved as version 1) of the object. Since report objects are hidden, the data object is hidden as well. This can be very confusing for the user as the data object appears momentarily in the narrative data panel and then disappears.

Two quick fixes:

  1. Document in the create_*report methods that the name supplied to the report should not collide with data objects.
  2. Before saving the report, check whether an object of the same name already exists and is not a report object, and fail if that is the case. This is subject to race conditions, and therefore not 100% reliable, so Fix 1) should still be implemented.

(Very) Longterm fix:
Add the ability for the workspace to abort a save if the object already exists and isn't one of a set of input types. This would reduce the possibility of the race condition, or potentially eliminate it.

Workaround:
Use a guaranteed unique name for the report object. If a name is not supplied, a unique name is generated by default.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions