Skip to content

Conversation

@ANISH-SR
Copy link
Contributor

@ANISH-SR ANISH-SR commented Jan 9, 2026

Summary of Changes

  • Now only allows closing an AccessPass when connection_count == 0; otherwise the instruction fails.
  • process_close_access_pass deserializes the AccessPass and blocks closure if active connections exist.
  • New test verifies close fails when connection_count > 0 and succeeds when it’s 0.
  • CHANGELOG.md updated.

Testing Verification

  • all rust + lint checks green

Resolves #2220

Copy link
Contributor

@juan-malbeclabs juan-malbeclabs left a comment

Choose a reason for hiding this comment

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

Please, it’s important to add a regression test that validates the behavior of your change. Thank you very much.

"AccessPass has active connections (connection_count={}), cannot close",
accesspass.connection_count
);
return Err(DoubleZeroError::AccessPassNotFound.into());
Copy link
Contributor

Choose a reason for hiding this comment

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

@ANISH-SR To avoid confusion, could you create a new AccessPassInUse error so it’s clearer why it can’t be closed? Thanks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done!

Signed-off-by: ANISH-SR <rawatanish08@gmail.com>
Signed-off-by: ANISH-SR <rawatanish08@gmail.com>
Signed-off-by: ANISH-SR <rawatanish08@gmail.com>
@ANISH-SR ANISH-SR force-pushed the verify-connection-count-2220 branch from 39ccfb6 to 3c50b48 Compare January 10, 2026 08:55
Copy link
Contributor

@juan-malbeclabs juan-malbeclabs left a comment

Choose a reason for hiding this comment

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

LGTM

@juan-malbeclabs juan-malbeclabs enabled auto-merge (squash) January 12, 2026 17:44
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.

In CloseAccessPass, verify that accesspass.connection_count == 0

2 participants