Skip to content

Crash on adding new moody after delete #2

Open

Description

@oldtrafford91

Here is scenario: After adding new new mood, I try to delete it and then add new one. It crash at:

public func saveOrRollback() -> Bool {
    do {
        try save()
        return true
    } catch {
        rollback()
        return false
    }
}

I do some debugging by lldb with po $arg1 and it say: Constraint violation

Activity

  1. floriankugler commented on Jan 1, 2016

    @floriankugler
    Contributor

    @oldtrafford91 Good catch – this happens because of a uniqueness constraint conflict on a Country or Continent entity. Those entities have a uniqueness constraint defined (using the numericISO3166Code attribute. However, this uniqueness constraint should also include the markedForDeletionDate attribute to allow deleted and non-deleted instances of a country/continent to co-exist. I'll push an update to the code, let's see if that fixes it.

  2. floriankugler commented on Jan 1, 2016

    @floriankugler
    Contributor

    @oldtrafford91 unfortunately this doesn't behave the way I expected it to... will think a bit more about what's a good solution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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