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

Logging in redraws the entire UI (with no animation), dismiss sheet not working in iOS 15 #8321

Open
bogdan-pechounov opened this issue Jul 28, 2023 · 1 comment

Comments

@bogdan-pechounov
Copy link

How frequently does the bug occur?

Always

Description

When a user logs in, they get taken back to the Home Screen without having to call dismiss. Is this the expected behaviour?

Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-07-28.at.11.56.01.mp4

(iPhone 14 Pro Max iOS 16.4)

It seems that the entire view is redrawn so there is no way to animate the transition from the login screen to the main screen. When using a sheet, the sheet is dismissed by itself.

Simulator.Screen.Recording.-.iPhone.14.Pro.Max.-.2023-07-28.at.12.13.12.mp4

When using iOS 15, this isn't the case. The sheet isn't dismissed even if I call dismiss.

Simulator.Screen.Recording.-.iPhone.SE.1st.generation.-.2023-07-28.at.12.15.45.mp4

(iPhone SE (1st generation) iOS 15)

Stacktrace & log output

APPEAR
2023-07-28 11:55:53.744790-0400 RealmTemplate[14545:16116914] [LayoutConstraints] Unable to simultaneously satisfy constraints.
	Probably at least one of the constraints in the following list is one you don't want. 
	Try this: 
		(1) look at each constraint and try to figure out which you don't expect; 
		(2) find the code that added the unwanted constraint or constraints and fix it. 
	(Note: If you're seeing NSAutoresizingMaskLayoutConstraints that you don't understand, refer to the documentation for the UIView property translatesAutoresizingMaskIntoConstraints) 
(
    "<NSAutoresizingMaskLayoutConstraint:0x60000230af80 h=-&- v=-&- ASAuthorizationAppleIDButton:0x7fa661f0d500.minX == 0   (active, names: '|':_TtGC7SwiftUI16PlatformViewHostGVS_P10$110b338b832PlatformViewRepresentableAdaptorV31_AuthenticationServices_SwiftUIP10$104b70c2417ViewRepresentable__:0x7fa660f0dd30 )>",
    "<NSAutoresizingMaskLayoutConstraint:0x60000230afd0 h=-&- v=-&- H:[ASAuthorizationAppleIDButton:0x7fa661f0d500]-(0)-|   (active, names: '|':_TtGC7SwiftUI16PlatformViewHostGVS_P10$110b338b832PlatformViewRepresentableAdaptorV31_AuthenticationServices_SwiftUIP10$104b70c2417ViewRepresentable__:0x7fa660f0dd30 )>",
    "<NSAutoresizingMaskLayoutConstraint:0x60000230b160 h=--& v=--& _TtGC7SwiftUI16PlatformViewHostGVS_P10$110b338b832PlatformViewRepresentableAdaptorV31_AuthenticationServices_SwiftUIP10$104b70c2417ViewRepresentable__:0x7fa660f0dd30.width == 398   (active)>",
    "<NSLayoutConstraint:0x600002319770 ASAuthorizationAppleIDButton:0x7fa661f0d500.width <= 375   (active)>"
)

Will attempt to recover by breaking constraint 
<NSLayoutConstraint:0x600002319770 ASAuthorizationAppleIDButton:0x7fa661f0d500.width <= 375   (active)>

Make a symbolic breakpoint at UIViewAlertForUnsatisfiableConstraints to catch this in the debugger.
The methods in the UIConstraintBasedLayoutDebugging category on UIView listed in <UIKitCore/UIView.h> may also be helpful.
2023-07-28 11:55:58.121148-0400 RealmTemplate[14545:16116914] Info: Realm sync client ([realm-core-13.17.0])
2023-07-28 11:55:58.121458-0400 RealmTemplate[14545:16116914] Info: Platform: iOS Darwin 22.5.0 Darwin Kernel Version 22.5.0: Thu Jun  8 22:22:22 PDT 2023; root:xnu-8796.121.3~7/RELEASE_X86_64 x86_64
2023-07-28 11:55:58.216321-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Session[1]: Binding '/Users/bogdan/Library/Developer/CoreSimulator/Devices/23014226-DA37-443E-A0F4-C3937ECC7F79/data/Containers/Data/Application/6EFE6341-F2A1-4A4A-9427-A6C4A0099069/Documents/mongodb-realm/realmswifttemplate-vtbbm/64c3e50d13b2b4aae69f47af/flx_sync_default.realm' to ''
2023-07-28 11:55:58.217447-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Session[1]: client_reset_config = false, Realm exists = true, client reset = false
2023-07-28 11:55:58.219558-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Connecting to 'wss://ws.us-west-2.aws.realm.mongodb.com:443/api/client/v2.0/app/realmswifttemplate-vtbbm/realm-sync'
APPEAR
2023-07-28 11:55:58.345398-0400 RealmTemplate[14545:16117708] Info: Connected to endpoint '54.212.159.174:443' (from '10.0.0.6:65332')
Logged in as user with id: 64c3e50d13b2b4aae69f47af
2023-07-28 11:55:58.870674-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Connected to app services with request id: "64c3e50eea16282310fda00a"
2023-07-28 11:55:59.185766-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Session[1]: Begin processing pending FLX bootstrap for query version 0. (changesets: 1, original total changeset size: 47)
2023-07-28 11:55:59.227618-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Session[1]: Integrated 1 changesets from pending bootstrap for query version 0, producing client version 10 in 41 ms. 0 changesets remaining in bootstrap
2023-07-28 11:55:59.540819-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Session[1]: Begin processing pending FLX bootstrap for query version 1. (changesets: 1, original total changeset size: 0)
2023-07-28 11:55:59.544285-0400 RealmTemplate[14545:16117708] Info: Connection[1]: Session[1]: Integrated 1 changesets from pending bootstrap for query version 1, producing client version 14 in 3 ms. 0 changesets remaining in bootstrap

Can you reproduce the bug?

Always

Reproduction Steps

Repo with navigation link

Repo with sheet

Version

13.7.0

What Atlas Services are you using?

Atlas Device Sync

Are you using encryption?

No

Platform OS and version(s)

macOS Ventura 13.4.1

Build environment

Xcode version: 14.3.1
Dependency manager and version: ...

@bogdan-pechounov
Copy link
Author

The lack of animation comes from changing the realm configuration if there is a logged in user.

struct ContentView: View {
    
    @StateObject var app = Realm.app
    
    var body: some View {
        MainScreen()
            .environmentObject(app)
            .if(app.currentUser) { view, user in
                view.environment(\.realmConfiguration, user.createFlexibleConfiguration())
            }
    }
}

I don't think environment values are meant to change, so the lack of animation might be expected.

@sync-by-unito sync-by-unito bot removed the T-Bug label Sep 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant