我把LiveQuery.init每一步都打印出来
init(
query,
{
subscriptionId: userDefinedSubscriptionId = AV._getSubscriptionId(),
} = {},
callback
) {
callback && callback('1');
requireRealtime();
if (!(query instanceof AV.Query)) {
callback && callback('e1');
throw new TypeError('LiveQuery must be inited with a Query');
}
return Promise.resolve(userDefinedSubscriptionId).then(
subscriptionId => {
callback && callback('2');
return AV._config.realtime
.createLiveQueryClient(subscriptionId)
.then(liveQueryClient => {
callback && callback('3');
const { where, keys, returnACL } = query.toJSON();
callback && callback('4');
const queryJSON = {
where,
keys,
returnACL,
className: query.className,
};
callback && callback('5');
const promise = subscribe(queryJSON, subscriptionId)
.then(({ query_id: queryId }) => {
callback && callback('6');
return new AV.LiveQuery(
queryId,
liveQueryClient,
queryJSON,
subscriptionId
);
})
.finally(() => {
callback && callback('7');
liveQueryClient.deregister(promise);
});
callback && callback('8');
liveQueryClient.register(promise);
callback && callback('9');
return promise;
});
}
);
},
打到2就没了, 第3步前面出了错