Skip to content

Conclude#follow accepts _id and makes every generated fact violate the ID rule #1345

Description

@gemshrine

Fbe::Conclude#follow allows _id, even though every new fact in the FBE factbase receives its own _id automatically. Following a source fact's _id then appends that old identifier to the new fact's already assigned identifier, violating the one-ID rule and aborting the transaction.

Steps to reproduce:

  1. Put a fact with an _id and a what value in the factbase.
  2. Run Fbe.conclude with a matching on query, follow '_id', and a draw block that creates a normal result.

Actual result: follow accepts _id, then fill copies it with fact.public_send(:_id=, v). Fbe.fb assigns a new _id when the result fact is inserted, so the copy makes that fact contain two _id values. The configured unique-ID rule raises ArgumentError and the conclusion rolls back instead of producing the result.

Expected result: reject _id in follow with an actionable Fbe::Error, like the existing checks for what and details, or explicitly exclude system identity fields from copying.

Technical evidence: lib/fbe/conclude.rb rejects only what and details in follow, and fill copies every listed property. lib/fbe/fb.rb assigns a fresh _id on insertion, while the FBE Factbase is wrapped in Factbase::Rules with uid: '_id', which rejects a fact containing more than one _id.

Activity

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