Giter VIP home page Giter VIP logo

Comments (17)

wdcurry avatar wdcurry commented on July 23, 2024

Bolts stops the app here:

  • (void)setError:(NSError *)error {
    if (![self trySetError:error]) {
    [NSException raise:NSInternalInconsistencyException
    format:@"Cannot set the error on a completed task."];
    }
    }

ALL this starts with the load operation of a PFQueryTableViewController as follows, reiterating that nothing in this ViewController was touched prior to the start of the errors. I have tagged the Parse guys from their Google Group to help:

- (BFTask *)loadObjects:(NSInteger)page clear:(BOOL)clear {
    self.loading = YES;
    [self objectsWillLoad];

    BFTaskCompletionSource *source = [BFTaskCompletionSource taskCompletionSource];

    PFQuery *query = [self queryForTable];
    [self _alterQuery:query forLoadingPage:page];
    [query findObjectsInBackgroundWithBlock:^(NSArray *foundObjects, NSError *error) {
        if (![Parse isLocalDatastoreEnabled] &&
            query.cachePolicy != kPFCachePolicyCacheOnly &&
            error.code == kPFErrorCacheMiss) {
            // no-op on cache miss
            return;
        }

        self.loading = NO;

        if (error) {
            _lastLoadCount = -1;
            [self _refreshPaginationCell];
        } else {
            _currentPage = page;
            _lastLoadCount = [foundObjects count];

            if (clear) {
                [_mutableObjects removeAllObjects];
            }

            [_mutableObjects addObjectsFromArray:foundObjects];
            [self.tableView reloadData];
        }

        [self objectsDidLoad:error];
        [self.refreshControl endRefreshing];

        [source setError:error];
    }];

    return source.task;
}

from bolts-objc.

wdcurry avatar wdcurry commented on July 23, 2024

For what it is worth, the app continues to work perfectly with this:

- (void)setError:(NSError *)error {

    if (!error) {
        NSLog(@"Bolts bug: setting nil error (their bug): %s", __PRETTY_FUNCTION__);
        return;
    }

    if (![self trySetError:error]) {
        [NSException raise:NSInternalInconsistencyException
                    format:@"Cannot set the error on a completed task."];
    }
}

On a fresh load of two rows, it gets hit 4x. On return to the view from a pushed view, it gets hit only once. This may provide a clue..

from bolts-objc.

wdcurry avatar wdcurry commented on July 23, 2024

And i did a simple textual comparison of the h&m files, and there were no changes at all. This seems to hint at something amiss via IB perhaps? Thus far, i am stumped for a strong indicator of the issue. It only manifests in this one view, which has nothing cutting edge on it at all..

from bolts-objc.

wdcurry avatar wdcurry commented on July 23, 2024

to continue my monologue: i rebuild all the lost work from the last good backup to the messed up version, documenting each step, and got to the point where the Bolts errors started and no issue at all. So clearly (at least to me) there is something internal to Bolts that is very sensitive to some activity with IB (as that is were most of the effort was) and yet this makes little sense.

Perhaps there is something in how i work, via copy and pasting existing code etc that causes this. It cannot be the code itself as i copied the exact code that lead to the situation.

Very puzzling.

from bolts-objc.

wdcurry avatar wdcurry commented on July 23, 2024

It happened again today, for no reason.

Even odder, and perhaps a clue. I simply ran the app on my device (not in debug mode), and it continued to work past the Bolts barf point while in debug mode. That is it, i am simply patching Bolts and moving on, and this is clearly an internal bug to either Parse or Bolts.

from bolts-objc.

dbarabander avatar dbarabander commented on July 23, 2024

+1 @wdcurry . I have the exact same thing, and posted in ParseUI. You can see here: https://github.com/ParsePlatform/ParseUI-iOS/issues/108

from bolts-objc.

kwkhaw avatar kwkhaw commented on July 23, 2024

+1 @wdcurry Thanks for the workaround. I encountered the same error when porting Anypic to Swift https://github.com/kwkhaw/SwiftAnyPic. I ended up by forking the Bolts-iOS and applied the workaround.

from bolts-objc.

tzapu avatar tzapu commented on July 23, 2024

could this be included in the master at any point?
works for me as well

from bolts-objc.

gadu avatar gadu commented on July 23, 2024

For what it's worth, this happened to me because of a caching issue, as soon as I changed the cachePolicy to kPFCachePolicyNetworkElseCache it stopped...

from bolts-objc.

ryancrosby avatar ryancrosby commented on July 23, 2024

I have ran into this problem a few times as well, the recent time was due to me calling loadData while the controller was already loading. I still can't determine what is actually causing setError to be called when the task is completed though.

from bolts-objc.

tzapu avatar tzapu commented on July 23, 2024

error also went away for me when i changed to kPFCachePolicyNetworkElseCache

from bolts-objc.

wdcurry avatar wdcurry commented on July 23, 2024

The error may disappear, but this pushes the caching behind the network call.. not ideal.

from bolts-objc.

 avatar commented on July 23, 2024

Any news on Parse updating to incorporate the workaround? Or do we need to fork our own and make the changes?

from bolts-objc.

 avatar commented on July 23, 2024

I keep having issues with the Bolts library. Says No such File or directory. I rebuild and it finds the previous file, but comes up with another bolts file not found. I am wondering if this has to do with the location of my project being on an external drive.

from bolts-objc.

nlutsenko avatar nlutsenko commented on July 23, 2024

Hey guys, I am going to close out this issue, since it looks like it's resolved.
Please let me know otherwise by commenting here or reopening it.

from bolts-objc.

dbarabander avatar dbarabander commented on July 23, 2024

@wdcurry workaround did the trick

from bolts-objc.

wdcurry avatar wdcurry commented on July 23, 2024

glad to help @dbarabander .. little tips like this can help make small-shop coders as effective as the big-boys!

from bolts-objc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.