Skip to content

Give the marker of Fbe.repeatedly an _id when it has none - #1333

Open
Thayorns wants to merge 1 commit into
zerocracy:masterfrom
Thayorns:1247
Open

Thayorns wants to merge 1 commit into
zerocracy:masterfrom
Thayorns:1247

Conversation

@Thayorns

Copy link
Copy Markdown
Contributor

Fbe.repeatedly created its marker with fb.insert and saved it with Fbe.overwrite. On a plain Factbase the marker had no _id, which Fbe.overwrite needs to replace a property that is already there, so the first run worked and the second one failed with "There is no _id in the fact, cannot use Fbe.overwrite". The existing tests all wrap the factbase in Fbe.fb, which assigns ids, so none of them saw it.

The marker now gets a random _id when it has none, the same way Fbe.iterate and Fbe::Tombstone handle their own facts. A marker that already has an _id, which is always the case under Fbe.fb, keeps it.

The tests run the judge twice on a plain Factbase, update an old marker that was stored without an _id, and check that a marker with an _id keeps it. With one more line in it, Fbe.repeatedly goes over the Metrics/AbcSize limit, which it was already close to (49.7 of 50), so it now carries # rubocop:disable Metrics/AbcSize like Fbe.fb and Fbe.overwrite.

Closes #1247

@Thayorns

Copy link
Copy Markdown
Contributor Author

@yegor256 take a look please, happy to clarify anything about the change.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fbe.repeatedly fails on the second run on a plain Factbase, because its marker has no _id

1 participant