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 and Infrastructure Optimizations #22

Merged
merged 11 commits into from
May 25, 2024

Conversation

finebel
Copy link
Owner

@finebel finebel commented May 25, 2024

  • Implement a NullStore to recover from a failed CoreDataFeedStore creation following the NullObject-Pattern
  • Implement logging using the os framework
  • Reduce number of cache misses by leveraging the NSManagedObjectContext.userInfo dictionary to avoid loosing all stored image data when inserting a new feed into the cache
  • Other performance improvements to reduce the overall number of network calls

finebel added 11 commits May 23, 2024 08:48
This way we avoid crashing, since the `CoreDataFeedStore` is not a critical component which is required to be able to use the application
Now we leverage the managedObjectContext.userInfo dictionary to prevent loosing all the stored image data on a new cache insertion
This way we avoid wasting resources for unnecessary tasks
… to prevent warnings about unsupported ordered relationships in SwiftData
…t the same time

Now, everytime we create / reuse a `FeedImageCell`, we reset the cell into a loading state with no retry button visible and an ongoing loading animation. Before, the cell would rely on the `LoadResourcePresenter` to call the appropriate `display` methods which would then configure the cell accordingly. But since we don't allow more than one loading operation for a given cell anymore, the loading triggered by `cellForRowAt` would have no effect, because the prefetch loading is still in progress.

See https://github.com/essentialdevelopercom/essential-feed-case-study/pull/69/files for reference
@finebel finebel merged commit 854135d into main May 25, 2024
1 check passed
@finebel finebel deleted the feature/image-feed/infrastructure-optimizations branch June 2, 2024 08:26
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.

1 participant