Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix broken migration #7643

Merged
merged 1 commit into from
Oct 12, 2020
Merged

Fix broken migration #7643

merged 1 commit into from
Oct 12, 2020

Conversation

stefanobaghino-da
Copy link
Contributor

The existing version of the migration replaced null values with
empty arrays. The presence of null values is used by the queries
to discriminate create and exercise events. This caused an
illegal state exception when reading active contracts for the API
(which are represented by their create events on the events table)
as the reader was mistakenly reading exercise events and create
events.

changelog_begin
changelog_end

Pull Request Checklist

  • Read and understand the contribution guidelines
  • Include appropriate tests
  • Set a descriptive title and thorough description
  • Add a reference to the issue this PR will solve, if appropriate
  • Include changelog additions in one or more commit message bodies between the CHANGELOG_BEGIN and CHANGELOG_END tags
  • Normal production system change, include purpose of change in description

NOTE: CI is not automatically run on non-members pull-requests for security
reasons. The reviewer will have to comment with /AzurePipelines run to
trigger the build.

The existing version of the migration replaced null values with
empty arrays. The presence of null values is used by the queries
to discriminate create and exercise events. This caused an
illegal state exception when reading active contracts for the API
(which are represented by their create events on the events table)
as the reader was mistakenly reading exercise events and create
events.

changelog_begin
changelog_end
Copy link
Contributor

@gerolf-da gerolf-da left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, @stefanobaghino-da!

Copy link

@ghost ghost left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch. How have you tested it?

@stefanobaghino-da
Copy link
Contributor Author

Good catch. How have you tested it?

@SamirTalwar-DA Manual testing with in-house application. Inspected the database, ensured that functionality of the app. This error condition only pops up when using "very old" pre-1.0 ledgers and the compatibility tests cannot cover this, unfortunately.

@mergify mergify bot merged commit 1571a0a into master Oct 12, 2020
@mergify mergify bot deleted the ste/fix-empty-arrays branch October 12, 2020 12:32
@ghost
Copy link

ghost commented Oct 12, 2020

Sounds good, thanks!

cocreature pushed a commit that referenced this pull request Oct 12, 2020
The existing version of the migration replaced null values with
empty arrays. The presence of null values is used by the queries
to discriminate create and exercise events. This caused an
illegal state exception when reading active contracts for the API
(which are represented by their create events on the events table)
as the reader was mistakenly reading exercise events and create
events.

changelog_begin
changelog_end
mergify bot pushed a commit that referenced this pull request Oct 12, 2020
The existing version of the migration replaced null values with
empty arrays. The presence of null values is used by the queries
to discriminate create and exercise events. This caused an
illegal state exception when reading active contracts for the API
(which are represented by their create events on the events table)
as the reader was mistakenly reading exercise events and create
events.

changelog_begin
changelog_end

Co-authored-by: Stefano Baghino <43749967+stefanobaghino-da@users.noreply.github.com>
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.

2 participants