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

use cl.ID instead of pk.Connect.ClientIdentifier when looking for existing clients in inheritClientSession #417

Merged
merged 4 commits into from
Jul 30, 2024

Conversation

SimonMacIntyre
Copy link
Contributor

@SimonMacIntyre SimonMacIntyre commented Jul 19, 2024

Fix #416

The reason I want to open this PR:

  • cl.ID is set from the pk.Connect.ClientIdentifier in clients.go, It also is the same value as the assignedClientId if there is one. Therefore it is more correct, but also for the reasons below:
  • This allows my custom implementation to rely on cl.ID and override it and the assigned id returned to the client(I assign intentional, known, client ids to specific clients. We want to control the client ids based on the authenticating client.)

All tests still pass, including the existing client takeover tests.

@mochi-co Do you think the existing tests are good for this, or do we want some kind of regression test case? I was looking at the tests to add one but to be honest, it is a bit beyond my Go skill level at the moment.

@SimonMacIntyre SimonMacIntyre changed the title Use cl.id instead of pk.Connect.ClientIdentifier when looking for existing clients in inheritClientSession check for client id assignment id instead of always using pk.Connect.ClientIdentifier when looking for existing clients in inheritClientSession Jul 19, 2024
@SimonMacIntyre SimonMacIntyre changed the title check for client id assignment id instead of always using pk.Connect.ClientIdentifier when looking for existing clients in inheritClientSession check for client assignment id instead of always using pk.Connect.ClientIdentifier when looking for existing clients in inheritClientSession Jul 19, 2024
@SimonMacIntyre SimonMacIntyre changed the title check for client assignment id instead of always using pk.Connect.ClientIdentifier when looking for existing clients in inheritClientSession use cl.ID instead of pk.Connect.ClientIdentifier when looking for existing clients in inheritClientSession Jul 21, 2024
@SimonMacIntyre
Copy link
Contributor Author

Huh, not sure I understand the pipeline failure, the tests all worked on this locally 🤔 Anything I can do?

@coveralls
Copy link

coveralls commented Jul 23, 2024

Pull Request Test Coverage Report for Build 10167435003

Details

  • 1 of 1 (100.0%) changed or added relevant line in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 98.623%

Totals Coverage Status
Change from base Build 10167421293: 0.0%
Covered Lines: 6160
Relevant Lines: 6246

💛 - Coveralls

@mochi-co
Copy link
Collaborator

@SimonMacIntyre Looks like it was just flakey tests 👍🏻

@mochi-co mochi-co merged commit 34f9370 into mochi-mqtt:main Jul 30, 2024
3 checks passed
@mochi-co
Copy link
Collaborator

Nice improvement here, thank you @SimonMacIntyre :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants