temp
This commit is contained in:
parent
f686a189a1
commit
0541485f5e
@ -13,7 +13,7 @@ type LazyLoadElement = Omit<LazyLoadElementBase, 'load'> & {
|
||||
wasSeen?: boolean,
|
||||
};
|
||||
|
||||
const PARALLEL_LIMIT = Infinity;
|
||||
const PARALLEL_LIMIT = 8;
|
||||
|
||||
export class LazyLoadQueueBase {
|
||||
public queueId = 0;
|
||||
|
@ -25,7 +25,7 @@ type UpdatesState = {
|
||||
lastPtsUpdateTime?: number
|
||||
};
|
||||
|
||||
const SYNC_DELAY = 25;
|
||||
const SYNC_DELAY = 6;
|
||||
|
||||
export class ApiUpdatesManager {
|
||||
public updatesState: UpdatesState = {
|
||||
@ -38,7 +38,7 @@ export class ApiUpdatesManager {
|
||||
public channelStates: {[channelId: number]: UpdatesState} = {};
|
||||
private attached = false;
|
||||
|
||||
private log = logger('UPDATES', LogLevels.error/* | LogLevels.log */);
|
||||
private log = logger('UPDATES', LogLevels.error | LogLevels.log | LogLevels.warn | LogLevels.debug);
|
||||
|
||||
constructor() {
|
||||
// * false for test purposes
|
||||
@ -137,7 +137,7 @@ export class ApiUpdatesManager {
|
||||
}
|
||||
}
|
||||
|
||||
processUpdateMessage = (updateMessage: any, options: Partial<{
|
||||
public processUpdateMessage = (updateMessage: any, options: Partial<{
|
||||
ignoreSyncLoading: boolean
|
||||
}> = {}) => {
|
||||
// return forceGetDifference()
|
||||
@ -148,6 +148,8 @@ export class ApiUpdatesManager {
|
||||
ignoreSyncLoading: options.ignoreSyncLoading
|
||||
};
|
||||
|
||||
this.log('processUpdateMessage', updateMessage);
|
||||
|
||||
switch(updateMessage._) {
|
||||
case 'updatesTooLong':
|
||||
case 'new_session_created':
|
||||
@ -425,7 +427,7 @@ export class ApiUpdatesManager {
|
||||
|
||||
if(update._ === 'updateChannelTooLong') {
|
||||
if(!curState.lastPtsUpdateTime ||
|
||||
curState.lastPtsUpdateTime < Date.now() - 10000) {
|
||||
curState.lastPtsUpdateTime < (Date.now() - SYNC_DELAY)) {
|
||||
// this.log.trace('channel too long, get diff', channelId, update)
|
||||
this.getChannelDifference(channelId);
|
||||
}
|
||||
@ -579,7 +581,7 @@ export class ApiUpdatesManager {
|
||||
} else {
|
||||
// ! for testing
|
||||
/* state.seq = 1;
|
||||
state.pts = state.pts - 1000;
|
||||
state.pts = state.pts - 15;
|
||||
state.date = 1; */
|
||||
|
||||
Object.assign(this.updatesState, state);
|
||||
|
@ -36,7 +36,6 @@ import appDownloadManager from './appDownloadManager';
|
||||
import appStateManager, { AppStateManager } from './appStateManager';
|
||||
import { MOUNT_CLASS_TO } from '../../config/debug';
|
||||
import appNavigationController from '../../components/appNavigationController';
|
||||
import { isSafari } from '../../helpers/userAgent';
|
||||
|
||||
//console.log('appImManager included33!');
|
||||
|
||||
|
@ -259,6 +259,11 @@ export class AppMessagesManager {
|
||||
|
||||
if(removeUnread && dialog.unread_count) dialog.unread_count -= removeUnread;
|
||||
|
||||
if(dialog.peerId < 0 && dialog.pts) {
|
||||
const newPts = apiUpdatesManager.channelStates[-dialog.peerId].pts;
|
||||
dialog.pts = newPts;
|
||||
}
|
||||
|
||||
dialog.unread_count = Math.max(0, dialog.unread_count);
|
||||
dialogs.push(dialog);
|
||||
|
||||
@ -3652,6 +3657,10 @@ export class AppMessagesManager {
|
||||
this.saveMessages([message], {storage});
|
||||
// this.log.warn(dT(), 'message unread', message.mid, message.pFlags.unread)
|
||||
|
||||
/* if((message as Message.message).grouped_id) {
|
||||
this.log('updateNewMessage', message);
|
||||
} */
|
||||
|
||||
const pendingMessage = this.checkPendingMessage(message);
|
||||
const historyStorage = this.getHistoryStorage(peerId);
|
||||
this.updateMessageRepliesIfNeeded(message);
|
||||
|
@ -87,7 +87,7 @@ export class ApiFileManager {
|
||||
|
||||
public downloadCheck(dcId: string | number) {
|
||||
const downloadPull = this.downloadPulls[dcId];
|
||||
const downloadLimit = dcId === 'upload' ? 24 : 48;
|
||||
const downloadLimit = dcId === 'upload' ? 24 : 24;
|
||||
//const downloadLimit = Infinity;
|
||||
|
||||
if(this.downloadActives[dcId] >= downloadLimit || !downloadPull || !downloadPull.length) {
|
||||
|
@ -18,7 +18,7 @@ export default class TcpObfuscated implements MTTransport {
|
||||
bodySent: boolean
|
||||
}>> = [];
|
||||
|
||||
private debug = Modes.debug && false;
|
||||
private debug = Modes.debug && false/* true */;
|
||||
private log: ReturnType<typeof logger>;
|
||||
public connected = false;
|
||||
private lastCloseTime: number;
|
||||
|
Loading…
Reference in New Issue
Block a user