Skip to content

Set disableoutputsubstitution to 'true' if used #485

Merged
DanGould merged 1 commit intopayjoin:masterfrom
arminsabouri:arm/fix/disableadditionaoutput
Jan 15, 2025
Merged

Set disableoutputsubstitution to 'true' if used #485
DanGould merged 1 commit intopayjoin:masterfrom
arminsabouri:arm/fix/disableadditionaoutput

Conversation

@arminsabouri
Copy link
Collaborator

I noticed this when I was writing tests for my new multiparty optional param. In the sender if we are setting disableoutputsubstitution we set it to a '1' value. However in the reciever we are parsing for 'true' string value if its set.

@arminsabouri
Copy link
Collaborator Author

While im in here I might push another commit to just test different permutations of urls. Lmk if you guys prefere that in a different PR, a different commit or just part of the first commit

@DanGould
Copy link
Contributor

Great catch

I believe the spec requires use of true rather than 1, so maybe this change needs to happen to the opposite location

@coveralls
Copy link
Collaborator

coveralls commented Jan 15, 2025

Pull Request Test Coverage Report for Build 12795364998

Details

  • 11 of 11 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 60.766%

Totals Coverage Status
Change from base Build 12791012687: 0.1%
Covered Lines: 2935
Relevant Lines: 4830

💛 - Coveralls

@arminsabouri arminsabouri force-pushed the arm/fix/disableadditionaoutput branch from 45f5cd9 to f7aa4cb Compare January 15, 2025 00:16
@arminsabouri
Copy link
Collaborator Author

Great catch

I believe the spec requires use of true rather than 1, so maybe this change needs to happen to the opposite location

You got it!

@DanGould
Copy link
Contributor

Also fyi, some URL permutation tests live in uri/mod.rs and uri/url_ext.rs. Were you trying to do a different kind of testing?

@arminsabouri arminsabouri force-pushed the arm/fix/disableadditionaoutput branch from f7aa4cb to de2b625 Compare January 15, 2025 18:27
@arminsabouri arminsabouri changed the title fix(recieve): parsing incorrect value of optional param disableoutputsubstitution Set disableoutputsubstitution to 'true' if used Jan 15, 2025
Copy link
Contributor

@DanGould DanGould left a comment

Choose a reason for hiding this comment

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

utACK de2b625

Clear commit message 🎆

Would be nice to have some regression test so this doesn't get reintroduced accidentally

Copy link
Collaborator

@spacebear21 spacebear21 left a comment

Choose a reason for hiding this comment

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

tACK de2b625

@DanGould
Copy link
Contributor

DanGould commented Jan 15, 2025

tACK de2b625@spacebear21

tACK meaning you tested this behavior specifically or that you ran the test suite? By convention going forward I'd like tACK to mean the former

@arminsabouri
Copy link
Collaborator Author

s set to '1' if the sender decides to disable output substitution which then the reciever will just
ignore.

I dont see any test coverage over reciever optional params. I was planning on writing some tests to cover those. Perhaps that belongs in a different PR.

Would be nice to have some regression test so this doesn't get reintroduced accidentally

Yeah let me see what I can do. It should be easy to write a regression test for this

@spacebear21
Copy link
Collaborator

I just ran the test suite - good point moving forward.

@arminsabouri arminsabouri force-pushed the arm/fix/disableadditionaoutput branch from de2b625 to 63deaaf Compare January 15, 2025 19:06
Per [bip78](https://github.com/bitcoin/bips/blob/master/bip-0078.mediawiki#user-content-span_idoutputsubstitutionspanPayment_output_substitution)
Currently the value is set to '1' if the sender decides to disable output substitution which then the reciever will just
ignore.
@arminsabouri arminsabouri force-pushed the arm/fix/disableadditionaoutput branch from 63deaaf to d3373a3 Compare January 15, 2025 19:12
@DanGould
Copy link
Contributor

DanGould commented Jan 15, 2025

Merging to keep the queue flowing. Hoping to see a regression test but no expectation there since not excluding one is no regression in itself (edit: afaict).

@DanGould DanGould merged commit 1d00fed into payjoin:master Jan 15, 2025
6 checks passed
@arminsabouri
Copy link
Collaborator Author

arminsabouri commented Jan 15, 2025

Merging to keep the queue flowing. Hoping to see a regression test but no expectation there since not excluding one is no regression in itself (edit: afaict).

I did end up including a test to ensure this doesnt get accidentaly re-introduced.

Would you have written a different test or expected something different?

@DanGould
Copy link
Contributor

Oh you did! my bad, I didn't realize you pushed more code after I ACKed, we don't have the protection on that prevents that merge by default.

This is what I would expect for a unit test, though send::serialize_url does make me wonder whether or not optional_parameters should define that function, and if it is truly a receive module or a general one

@arminsabouri
Copy link
Collaborator Author

Oh you did! my bad, I didn't realize you pushed more code after I ACKed, we don't have the protection on that prevents that merge by default.

This is what I would expect for a unit test, though send::serialize_url does make me wonder whether or not optional_parameters should define that function, and if it is truly a receive module or a general one

All good! Yeah we can add a branch protection to dismiss review on force updates.

Yeah it would make sense to me if this url was more general not belonging to either the sender or reciever. Instead a shared type

@DanGould
Copy link
Contributor

I set "Require approval of the most recent reviewable push" restriction on master

I believe url is general but optional query parameters that get sent are not. optional parameters are not abstracted in the sender, as demonstrated by the change was in send/mod.rs, they're only abstracted in the receiver/optional_parameters.rs.

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