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 broken view hierarchy in Xcode #991

Merged
merged 3 commits into from
Apr 17, 2024

Conversation

Gio2018
Copy link
Collaborator

@Gio2018 Gio2018 commented Apr 10, 2024

Summary

  • Apparently, not declaring RootViewModel as a state object works but breaks the view hierarchy in Xcode..

References

  • Links to docs, tickets, designs if available

Implementation Details

  • Declared @StateObject private var rootViewModel = RootViewModel() in PocketApp, removed the init() and added the start() method to the init() method in RootViewModel. This should not make a difference since the passed objects and the sequence of calls is unchanged. We need to do additional considerations when we enable multi windows, but the model likely can stay the same.

Test Steps

  • Build/run with Xcode, then make sure the view hierarchy appears
  • Smoke test the app and make sure it works as expected

PR Checklist:

  • Added Unit / UI tests
  • Self Review (review, clean up, documentation, run tests)
  • Basic Self QA

@Gio2018 Gio2018 added bug Something isn't working Xcode labels Apr 10, 2024
@Gio2018 Gio2018 added this to the 8.7.0 milestone Apr 10, 2024
@Gio2018 Gio2018 self-assigned this Apr 10, 2024
@Gio2018 Gio2018 requested a review from bassrock as a code owner April 10, 2024 19:43
@pocket-ci
Copy link
Contributor

pocket-ci commented Apr 10, 2024

Messages
📖 No SwiftLint violations! 🎉
📖 Project coverage: 36.65%
📖 Checking XCode Environment Variables
📖 Edited 6 files
📖 Created 0 files

Pocket.app: Coverage: 100.0

File Coverage
PocketApp.swift 100.0%

PocketKit: Coverage: 62.02

File Coverage
PocketAppDelegate.swift 64.81%
RootViewModel.swift 73.6%
Services.swift 96.43%

SaveToPocketKit: Coverage: 26.61

File Coverage
MainViewController.swift 0.0% ⚠️

SharedPocketKit: Coverage: 65.29

File Coverage
SignOutOnFirstLaunch.swift 100.0%

SaveToPocketKitTests: Coverage: 0.0

File Coverage
MainViewController.swift 0.0% ⚠️

SharedPocketKitTests: Coverage: 24.27

File Coverage
SignOutOnFirstLaunch.swift 100.0%

PocketKitTests: Coverage: 28.43

File Coverage
SignOutOnFirstLaunch.swift 100.0%
Services.swift 95.41%
PocketAppDelegate.swift 69.1%
RootViewModel.swift 76.0%

Generated by 🚫 Danger Swift against 7f63508

@Gio2018 Gio2018 marked this pull request as draft April 11, 2024 17:18
@Gio2018 Gio2018 added the 🛑 DO NOT MERGE Do not merge label Apr 11, 2024
@Gio2018 Gio2018 removed this from the 8.7.0 milestone Apr 11, 2024
@Gio2018 Gio2018 force-pushed the fix/POCKET-9953-broken-view-hierarchy branch 5 times, most recently from c5259d9 to 7f63508 Compare April 12, 2024 20:58
Gio2018 added 3 commits April 17, 2024 11:14
… once and for all

* As a consequence, include the start() method in RootViewModel.init()
… calls since updating PocketApp has restored the role of AppDelegate in the launch sequence
@Gio2018 Gio2018 force-pushed the fix/POCKET-9953-broken-view-hierarchy branch from 7f63508 to 5e3e73e Compare April 17, 2024 16:14
@Gio2018 Gio2018 removed the 🛑 DO NOT MERGE Do not merge label Apr 17, 2024
@Gio2018 Gio2018 marked this pull request as ready for review April 17, 2024 16:15
@Gio2018 Gio2018 merged commit 7173a33 into develop Apr 17, 2024
1 check failed
@Gio2018 Gio2018 deleted the fix/POCKET-9953-broken-view-hierarchy branch April 17, 2024 16:18
Copy link

sentry-io bot commented Apr 18, 2024

Suspect Issues

This pull request was deployed and Sentry observed the following issues:

  • ‼️ LegacyPasswordRetriever View Issue
  • ‼️ App Hanging: App hanging for at least 2000 ms. AsyncOperation.init View Issue
  • ‼️ App Hanging: App hanging for at least 2000 ms. LegacyUserMigration View Issue
  • ‼️ App Hanging: App hanging for at least 2000 ms. NSUserDefaults.bool View Issue
  • ‼️ App Hanging: App hanging for at least 2000 ms. $sScTss5NeverORs_rlE8priority9operationScTyxABG... View Issue

Did you find this useful? React with a 👍 or 👎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working Xcode
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants