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

[ASDKgram Example] fix crash on startup #566

Merged
merged 6 commits into from
Sep 16, 2017

Conversation

hannahmbanana
Copy link
Contributor

No description provided.

Copy link
Contributor

@maicki maicki left a comment

Choose a reason for hiding this comment

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

Thanks Hannah ❤️

@hannahmbanana
Copy link
Contributor Author

Actually, hold off on merging this. I'm missing a file.

@hannahmbanana
Copy link
Contributor Author

ready to merge

@ghost
Copy link

ghost commented Sep 14, 2017

1 Warning
⚠️ Please ensure license is correct for PhotoFeedBaseController.m:

//
//  PhotoFeedBaseController.m
//  Texture
//
//  Copyright (c) 2014-present, Facebook, Inc.  All rights reserved.
//  This source code is licensed under the BSD-style license found in the
//  LICENSE file in the /ASDK-Licenses directory of this source tree. An additional
//  grant of patent rights can be found in the PATENTS file in the same directory.
//
//  Modifications to this file made after 4/13/2017 are: Copyright (c) 2017-present,
//  Pinterest, Inc.  Licensed under the Apache License, Version 2.0 (the "License");
//  you may not use this file except in compliance with the License.
//  You may obtain a copy of the License at
//
//      http://www.apache.org/licenses/LICENSE-2.0
//

    

Generated by 🚫 Danger

@@ -59,7 +59,7 @@ - (void)refreshFeed

[_activityIndicatorView stopAnimating];

[self insertNewRows:newPhotos];
[self.tableView reloadData];
Copy link
Member

@nguyenhuy nguyenhuy Sep 14, 2017

Choose a reason for hiding this comment

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

I would personally shy away from calling reloadData in a sample project, as we've been asking people to avoid using it and call insert/delete/move instead. Maybe it's time to employ a diffing algorithm (either built-in or from 3rd-party) to show how it's supposed to be done? A bit overkill I know, as the data almost certainly has new rows only.

Copy link
Member

Choose a reason for hiding this comment

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

@nguyenhuy Yes, I agree. A couple thoughts though:

  • We do have the IGListKit version of ASDKgram in place; we could consider making it the only implementation, although I'm not sure how easy it is for a new developer to get set up using it with ASCollectionNode, because we don't have docs about it.

  • This fix addresses a pretty serious crash that has been in place for a while. I asked Hannah offline and she is planning to make other changes to ensure only edit operations are used, but the network / loading code needs a small overhaul to be able to do it.

Fortunately the reloadData only occurs during a full reload (e.g. pull to refresh or first load), so it doesn't affect the loading of new batches / pages while scrolling down.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good 👌

@appleguy appleguy merged commit dcaca52 into TextureGroup:master Sep 16, 2017
bernieperez pushed a commit to AtomTickets/Texture that referenced this pull request Apr 25, 2018
* fix crash on ASDKgram startup

* quicker fix
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.

4 participants