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

[Sign] Dapp extend session exp #1187

Merged
merged 3 commits into from
Oct 25, 2023
Merged

[Sign] Dapp extend session exp #1187

merged 3 commits into from
Oct 25, 2023

Conversation

alexander-lsvk
Copy link
Contributor

Description

Resolves # (issue)

How Has This Been Tested?

Due Dilligence

  • Breaking change
  • Requires a documentation update

@alexander-lsvk alexander-lsvk temporarily deployed to internal October 17, 2023 10:43 — with GitHub Actions Inactive
@alexander-lsvk
Copy link
Contributor Author

@flypaper0 extracting the update/extend method to the one service is a bit tricky, cuz NonController also observes the changes made to the session from the wallet side. I'll think about how to refactor this later, cuz it's P1.

@alexander-lsvk alexander-lsvk temporarily deployed to internal October 17, 2023 11:25 — with GitHub Actions Inactive
@alexander-lsvk alexander-lsvk temporarily deployed to internal October 17, 2023 11:28 — with GitHub Actions Inactive
Comment on lines 270 to 273
if session.selfIsController {
try await controllerSessionStateMachine.extend(topic: topic, by: ttl)
} else {
try await nonControllerSessionStateMachine.extend(topic: topic, by: ttl)
Copy link
Contributor

Choose a reason for hiding this comment

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

wouldn't be easier to just extract generic "sessionExtendRequester" and have an extend logic in one place?

are the implementations for a dapp and a wallet any different?

Copy link
Contributor

@llbartekll llbartekll left a comment

Choose a reason for hiding this comment

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

I would just extract the extend service as it seems like the logic is the same.

@alexander-lsvk alexander-lsvk temporarily deployed to internal October 24, 2023 12:38 — with GitHub Actions Inactive
@alexander-lsvk alexander-lsvk temporarily deployed to internal October 24, 2023 12:43 — with GitHub Actions Inactive
@alexander-lsvk
Copy link
Contributor Author

@llbartekll please check again

Copy link
Contributor

@llbartekll llbartekll left a comment

Choose a reason for hiding this comment

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

Could we also maybe now extract the on extend part?
now the logic is shared and we still keep request handling and responding in controller and non-controller services.
in let's say SessionExtendRequestSubscriber - that will handle the request and respond
and if needed SessionExtendResponseSubscriber that will handle the response.

@alexander-lsvk alexander-lsvk temporarily deployed to internal October 25, 2023 12:54 — with GitHub Actions Inactive
@alexander-lsvk alexander-lsvk temporarily deployed to internal October 25, 2023 13:07 — with GitHub Actions Inactive
@alexander-lsvk alexander-lsvk merged commit f7ffc79 into develop Oct 25, 2023
8 checks passed
@alexander-lsvk alexander-lsvk deleted the dapp-extend-session branch October 25, 2023 13:50
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