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 stream replay in validators #1678

Merged
merged 3 commits into from
Mar 30, 2023
Merged

Fix stream replay in validators #1678

merged 3 commits into from
Mar 30, 2023

Conversation

RobbeSneyders
Copy link
Member

The current implementation of replaying the stream will always replay the first message. This PR fixes this by progressing through the messages with each call.

@RobbeSneyders RobbeSneyders added this to the Connexion 3.0 milestone Mar 28, 2023
@RobbeSneyders RobbeSneyders requested a review from Ruwann March 28, 2023 14:06
@RobbeSneyders
Copy link
Member Author

cc: @julienschuermans

@coveralls
Copy link

coveralls commented Mar 28, 2023

Pull Request Test Coverage Report for Build 4568397653

  • 3 of 5 (60.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-0.02%) to 93.373%

Changes Missing Coverage Covered Lines Changed/Added Lines %
connexion/validators/abstract.py 3 5 60.0%
Totals Coverage Status
Change from base Build 4509914667: -0.02%
Covered Lines: 3297
Relevant Lines: 3531

💛 - Coveralls

connexion/validators/abstract.py Outdated Show resolved Hide resolved
connexion/validators/abstract.py Outdated Show resolved Hide resolved
tests/test_validation.py Outdated Show resolved Hide resolved
more_body = message.get("more_body", False)

assert len(replay) <= len(messages), (
"Replayed more messages than received, " "break out of while loop"
Copy link
Member

Choose a reason for hiding this comment

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

this can be a single string instead of two?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, black did this.

Copy link
Member Author

Choose a reason for hiding this comment

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

The solution is ugly though 🤮

Copy link
Member

Choose a reason for hiding this comment

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

yikes

Copy link
Member

@Ruwann Ruwann left a comment

Choose a reason for hiding this comment

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

LGTM, one minor comment on the assertion message

@julienschuermans
Copy link
Contributor

Fantastic work! Can't wait for the next release 🥇

@RobbeSneyders RobbeSneyders merged commit 55e376f into main Mar 30, 2023
@RobbeSneyders RobbeSneyders deleted the bugfix/stream-replay branch March 30, 2023 20:12
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.

4 participants