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/ABW-957 Biometrics check cancelled causes blank screen #295

Merged
merged 4 commits into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,5 +38,6 @@ extension CreationOfEntity.Action {
extension CreationOfEntity.Action {
public enum DelegateAction: Sendable, Equatable {
case createdEntity(Entity)
case biometricsCheckFailed
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,10 @@ public struct CreationOfEntity<Entity: EntityProtocol>: Sendable, ReducerProtoco
))))
}

case let .internal(.system(.createEntityResult(.failure(error)))):
errorQueue.schedule(error)
return .none
case .internal(.system(.createEntityResult(.failure))):
return .run { send in
await send(.delegate(.biometricsCheckFailed))
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
return .run { send in
await send(.delegate(.biometricsCheckFailed))
}
return .send(.delegate(.biometricsCheckFailed))

Copy link
Contributor

Choose a reason for hiding this comment

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

Wholeheartedly endorse this suggested change...

Copy link
Contributor

Choose a reason for hiding this comment

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

It also just became Point-Free canon yesterday https://www.pointfree.co/episodes/ep222-composable-navigation-tabs

image

Copy link
Contributor

Choose a reason for hiding this comment

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

Unresolved for the rest of the team's visibility.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also heard that last night. If they are serious about it, I wonder if they couldn't provide a separate pathway for delegate actions, so we don't need to manually ignore them in the child reducer, and also don't have to go full nesting with .view...

Copy link
Contributor

@davdroman-rdx davdroman-rdx Feb 14, 2023

Choose a reason for hiding this comment

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

Well at least we have FeatureReducer now which ignores them by default. But I do agree if it becomes a widespread pattern it might be worth protocolizing it like they did with BindingAction... though seeing how involved that API ended up in practice it might just be best to keep it as-is.


case let .internal(.system(.createEntityResult(.success(entity)))):
return .run { send in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,10 @@ public struct CreateEntityCoordinator<
state: &state
)

case .child(.step2_creationOfEntity(.delegate(.biometricsCheckFailed))):
state.step = .step0_nameNewEntity(.init(config: state.config))
return .none

case .child(.step3_completion(.delegate(.completed))):
return .run { send in
await send(.delegate(.completed))
Expand Down