quickblox-react-ui-kit 0.5.0-beta.11 → 0.5.0-beta.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/App.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,CAAC;AAkBpB,iBAAS,GAAG,4CAwOX;AAED,eAAe,GAAG,CAAC"}
1
+ {"version":3,"file":"App.d.ts","sourceRoot":"","sources":["../src/App.tsx"],"names":[],"mappings":"AACA,OAAO,YAAY,CAAC;AAkBpB,iBAAS,GAAG,4CA6OX;AAED,eAAe,GAAG,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"Creator.d.ts","sourceRoot":"","sources":["../../src/Data/Creator.ts"],"names":[],"mappings":"AAAA,OAAO,2BAA2B,MAAM,8CAA8C,CAAC;AACvF,OAAO,EAAE,UAAU,EAAE,MAAM,8BAA8B,CAAC;AAC1D,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,UAAU,EAAE,MAAM,6BAA6B,CAAC;AAIzD,MAAM,MAAM,mBAAmB,GAAG;IAChC,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,aAAa,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IAC9B,QAAQ,CAAC,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC;IACzB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,YAAY,EAAE,MAAM,CAAC;IACrB,WAAW,CAAC,EAAE,2BAA2B,EAAE,CAAC;IAC5C,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EzD,OAAc,iBAAiB,SAAkB;IAEjD,OAAc,2BAA2B,SAAwB;IAEjE,OAAO,CAAC,MAAM,CAAC,2BAA2B;IAO1C,OAAO,CAAC,MAAM,CAAC,0BAA0B;WAO3B,aAAa,CAAC,SAAS,EAAE,MAAM;WAW/B,eAAe,CAAC,SAAS,EAAE,MAAM;IAQ/C,OAAO,CAAC,MAAM,CAAC,iBAAiB;IAMhC,OAAO,CAAC,MAAM,CAAC,WAAW;IA8J1B,OAAO,CAAC,MAAM,CAAC,iBAAiB;CA2IjC"}
@@ -34,6 +34,7 @@ export declare class RemoteDataSource implements IRemoteDataSource {
34
34
  private joinCheckInterval;
35
35
  private processedDialogs;
36
36
  private userCache;
37
+ private userCachePreloadInterval;
37
38
  private userDTOMapper;
38
39
  private messageDTOMapper;
39
40
  private fileDTOMapper;
@@ -49,6 +50,7 @@ export declare class RemoteDataSource implements IRemoteDataSource {
49
50
  set authInformation(value: AuthorizationData | undefined);
50
51
  private currentDialog;
51
52
  getCurrentDialogDTOMapper(): IDTOMapper;
53
+ private startUserCachePreload;
52
54
  constructor();
53
55
  createAnswer(text: string, messages: AIChatHistory, smartChatAssistantId: string): Promise<AIAnswerResponse>;
54
56
  translate(text: string, languageCode: string, smartChatAssistantId: string): Promise<AIAnswerResponse>;
@@ -76,10 +78,7 @@ export declare class RemoteDataSource implements IRemoteDataSource {
76
78
  initEventsHandlers(): void;
77
79
  releaseEventsHandlers(): void;
78
80
  loginWithUser(authParams: LoginData): Promise<void>;
79
- private startJoinRetryProcess;
80
81
  private joinGroupDialog;
81
- private processDialogsInBackground;
82
- private processDialogs;
83
82
  getDialogs(pagination?: Pagination): Promise<RemoteDialogsDTO>;
84
83
  createDialog(dto: RemoteDialogDTO): Promise<RemoteDialogDTO>;
85
84
  updateDialog(dto: RemoteDialogDTO): Promise<RemoteDialogDTO>;
@@ -1 +1 @@
1
- {"version":3,"file":"RemoteDataSource.d.ts","sourceRoot":"","sources":["../../../../src/Data/source/remote/RemoteData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aAAa,CAAC;IAKnD,UAAU,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,IAAI,CAAC;IAK7C,+BAA+B,CAEnC,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,IAAI,CAAC;CAGjB"}
package/dist/index-ui.js CHANGED
@@ -62278,8 +62278,10 @@ class Creator {
62278
62278
  };
62279
62279
  const blobFile = await fetch(imageSrc)
62280
62280
  .catch(async function () {
62281
- const response = await fetch(imageSrc);
62282
- if (response.ok) {
62281
+ const response = await fetch(imageSrc).catch((reason) => {
62282
+ console.error('Image fetch error', reason);
62283
+ });
62284
+ if (response?.ok) {
62283
62285
  await setBlob(response);
62284
62286
  }
62285
62287
  })
@@ -64298,7 +64300,13 @@ class MessageDTOMapper {
64298
64300
  const dto = new RemoteMessageDTO();
64299
64301
  if (!offValidate) {
64300
64302
  // original version
64301
- MessageDTOMapper.validateQBMessage(qbMessage);
64303
+ try {
64304
+ MessageDTOMapper.validateQBMessage(qbMessage);
64305
+ }
64306
+ catch (e) {
64307
+ console.log('Error validating QBChatMessage: (' + JSON.stringify(qbMessage) + ')');
64308
+ console.error(e);
64309
+ }
64302
64310
  dto.id = qbMessage._id;
64303
64311
  dto.dialogId = qbMessage.chat_dialog_id;
64304
64312
  dto.message = qbMessage.message; // MessageDTOMapper.formatMessage(qbMessage.message);
@@ -65351,6 +65359,7 @@ class RemoteDataSource {
65351
65359
  joinCheckInterval = null;
65352
65360
  processedDialogs = new Set();
65353
65361
  userCache = new Map();
65362
+ userCachePreloadInterval = null;
65354
65363
  userDTOMapper;
65355
65364
  messageDTOMapper;
65356
65365
  fileDTOMapper;
@@ -65397,6 +65406,37 @@ class RemoteDataSource {
65397
65406
  return dialogDTOMapper;
65398
65407
  }
65399
65408
  //
65409
+ startUserCachePreload() {
65410
+ if (this.userCachePreloadInterval)
65411
+ return; // Избегаем повторного запуска
65412
+ this.userCachePreloadInterval = setInterval(async () => {
65413
+ try {
65414
+ const pagination = new Pagination(1, 100); // Пагинация по 100 пользователей
65415
+ let hasMoreUsers = true;
65416
+ while (hasMoreUsers) {
65417
+ const { ResultData, PaginationResult } = await this.getAllUsers(pagination);
65418
+ for (const user of ResultData) {
65419
+ if (!this.userCache.has(user.id)) {
65420
+ this.userCache.set(user.id, user);
65421
+ }
65422
+ }
65423
+ if (PaginationResult.getCurrentPage() >= PaginationResult.totalPages) {
65424
+ hasMoreUsers = false;
65425
+ }
65426
+ else {
65427
+ pagination.setCurrentPage(pagination.getCurrentPage() + 1);
65428
+ }
65429
+ }
65430
+ console.log(`User cache preload complete. Loaded ${this.userCache.size} users.`);
65431
+ clearInterval(this.userCachePreloadInterval);
65432
+ this.userCachePreloadInterval = null;
65433
+ }
65434
+ catch (error) {
65435
+ console.error('Error during user cache preload:', error);
65436
+ }
65437
+ }, 4500); // Интервал 10 секунд
65438
+ }
65439
+ //
65400
65440
  constructor() {
65401
65441
  console.log('CONSTRUCTOR RemoteDataSourceMock');
65402
65442
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
@@ -65423,6 +65463,7 @@ class RemoteDataSource {
65423
65463
  new SubscriptionPerformer();
65424
65464
  this.subscriptionOnSystemMessages[NotificationTypes.NEW_DIALOG] =
65425
65465
  new SubscriptionPerformer();
65466
+ this.startUserCachePreload();
65426
65467
  }
65427
65468
  // eslint-disable-next-line class-methods-use-this
65428
65469
  createAnswer(text, messages, smartChatAssistantId) {
@@ -65895,26 +65936,11 @@ class RemoteDataSource {
65895
65936
  //
65896
65937
  }
65897
65938
  //get dialogs flow
65898
- startJoinRetryProcess() {
65899
- if (this.joinCheckInterval)
65900
- return; // Избегаем дублирования таймера
65901
- this.joinCheckInterval = setInterval(async () => {
65902
- const dialogsToRetry = Array.from(this.joinStatusMap.entries())
65903
- .filter(([_, isJoined]) => !isJoined) // Только неприсоединённые
65904
- .map(([id]) => id);
65905
- if (dialogsToRetry.length === 0) {
65906
- clearInterval(this.joinCheckInterval);
65907
- this.joinCheckInterval = null;
65908
- console.log('All dialogs successfully joined. Stopping retry process.');
65909
- return;
65910
- }
65911
- console.log(`Retrying join for ${dialogsToRetry.length} dialogs...`);
65912
- await this.processDialogs(dialogsToRetry);
65913
- }, 7000);
65914
- }
65915
65939
  async joinGroupDialog(dialogId) {
65916
65940
  try {
65917
- await QBJoinGroupDialog(dialogId);
65941
+ await QBJoinGroupDialog(dialogId).catch(() => {
65942
+ throw new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);
65943
+ });
65918
65944
  this.joinStatusMap.set(dialogId, true);
65919
65945
  }
65920
65946
  catch (reason) {
@@ -65922,66 +65948,171 @@ class RemoteDataSource {
65922
65948
  this.joinStatusMap.set(dialogId, false);
65923
65949
  }
65924
65950
  }
65925
- async processDialogsInBackground(dialogIds) {
65926
- const BATCH_SIZE = 12;
65927
- console.log(`Starting background processing for ${dialogIds.length} dialogs`);
65928
- for (let i = 0; i < dialogIds.length; i += BATCH_SIZE) {
65929
- const batch = dialogIds.slice(i, i + BATCH_SIZE);
65930
- console.log(`Processing batch ${i / BATCH_SIZE + 1}:`, batch);
65931
- await Promise.all(batch.map((id) => this.joinGroupDialog(id)));
65932
- console.log(`Batch ${i / BATCH_SIZE + 1} completed.`);
65933
- await new Promise((resolve) => setTimeout(resolve, 1500));
65934
- }
65935
- console.log('Background processing complete.');
65936
- }
65937
- async processDialogs(dialogIds) {
65938
- await Promise.all(dialogIds.map((id) => this.joinGroupDialog(id)));
65939
- }
65940
65951
  async getDialogs(pagination) {
65941
65952
  let currentPagination = pagination || new Pagination();
65953
+ console.log('call getDialogs in RemoteDataSourceMock param pagination: ', JSON.stringify(pagination));
65954
+ console.log('call getDialogs in RemoteDataSourceMock with result pagination: ', JSON.stringify(currentPagination));
65942
65955
  const pageNumber = currentPagination.getCurrentPage() || 1;
65956
+ console.log('pageNumber: ', pageNumber);
65943
65957
  const perPage = currentPagination.perPage || 100;
65958
+ console.log('perPage: ', perPage);
65944
65959
  const params = {
65945
- created_at: { lt: Date.now() / 1000 },
65960
+ created_at: {
65961
+ lt: Date.now() / 1000,
65962
+ },
65963
+ // sort_desc: 'created_at',// artan 19.0.2024
65946
65964
  sort_desc: 'updated_at',
65947
65965
  page: pageNumber,
65966
+ // per_page: perPage,
65948
65967
  limit: perPage,
65949
- type: { in: [2, 3] },
65968
+ type: {
65969
+ in: [2, 3],
65970
+ },
65950
65971
  };
65972
+ // filter['type[in]'] = [3, 2].join(',');
65973
+ console.log('call getDialogs in RemoteDataSourceMock with params: ', JSON.stringify(params));
65951
65974
  const dialogsDTO = [];
65952
- const joinDialogIds = [];
65953
65975
  const qbDialogs = await QBGetDialogs(params);
65954
65976
  if (qbDialogs) {
65977
+ console.log(`request completed. have: total_entries ${qbDialogs.total_entries}, limit: ${qbDialogs.limit}, skip: ${qbDialogs.skip} items: ${JSON.stringify(qbDialogs.items)}`);
65955
65978
  currentPagination = new Pagination(0, perPage);
65956
65979
  currentPagination.totalPages = qbDialogs.total_entries / perPage;
65957
65980
  currentPagination.setCurrentPage(pageNumber);
65981
+ // eslint-disable-next-line no-restricted-syntax
65958
65982
  for (const item of qbDialogs.items) {
65959
65983
  const qbEntity = item;
65960
- if (!qbEntity)
65984
+ if (!qbEntity) {
65961
65985
  continue;
65962
- const newDTO = await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
65963
- if (newDTO.type === DialogType.group && !this.processedDialogs.has(newDTO.id)) {
65964
- this.processedDialogs.add(newDTO.id);
65965
- // Если уже есть в Map — пропускаем, иначе добавляем в joinDialogIds
65986
+ }
65987
+ const newDTO =
65988
+ // eslint-disable-next-line no-await-in-loop
65989
+ await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
65990
+ if (newDTO.type === DialogType.group) {
65991
+ // eslint-disable-next-line no-await-in-loop
65966
65992
  if (!this.joinStatusMap.has(newDTO.id)) {
65967
- this.joinStatusMap.set(newDTO.id, false);
65968
- joinDialogIds.push(newDTO.id);
65993
+ await this.joinGroupDialog(newDTO.id);
65969
65994
  }
65995
+ // await QBJoinGroupDialog(newDTO.id).catch((reason) => {
65996
+ // console.log('getDialogs. QBJoinGroupDialog error', reason);
65997
+ // throw new RemoteDataSourceException(
65998
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
65999
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
66000
+ // );
66001
+ // });
65970
66002
  }
66003
+ //
66004
+ // const currentUserId = this._authInformation?.userId || 0;
66005
+ // const statusMessageParams: QBMessageStatusParams = {
66006
+ // userId: newDTO.lastMessageUserId || currentUserId,
66007
+ // dialogId: newDTO.id,
66008
+ // messageId: newDTO.lastMessageId,
66009
+ // };
66010
+ //
66011
+ // // eslint-disable-next-line @typescript-eslint/no-unsafe-call
66012
+ // QBChatMarkMessageDelivered(statusMessageParams);
65971
66013
  dialogsDTO.push(newDTO);
65972
66014
  }
65973
- // Сначала выполняем попытку подключиться к первой партии
65974
- const firstBatch = joinDialogIds.slice(0, 12);
65975
- await this.processDialogs(firstBatch);
65976
- // Для оставшихся используем фоновый процесс и вечный таймер
65977
- const remainingDialogs = joinDialogIds.slice(12);
65978
- if (remainingDialogs.length) {
65979
- await this.processDialogsInBackground(remainingDialogs); // Фоновая обработка
65980
- this.startJoinRetryProcess(); // Вечный таймер для оставшихся
65981
- }
65982
66015
  }
65983
66016
  return Promise.resolve(new RemoteDialogsDTO(dialogsDTO, currentPagination));
65984
66017
  }
66018
+ //version 0.5.0-beta.11 - 12
66019
+ // private startJoinRetryProcess(): void {
66020
+ // if (this.joinCheckInterval) return; // Избегаем дублирования таймера
66021
+ //
66022
+ // this.joinCheckInterval = setInterval(async () => {
66023
+ // const dialogsToRetry = Array.from(this.joinStatusMap.entries())
66024
+ // .filter(([_, isJoined]) => !isJoined) // Только неприсоединённые
66025
+ // .map(([id]) => id);
66026
+ //
66027
+ // if (dialogsToRetry.length === 0) {
66028
+ // clearInterval(this.joinCheckInterval!);
66029
+ // this.joinCheckInterval = null;
66030
+ // console.log('All dialogs successfully joined. Stopping retry process.');
66031
+ // return;
66032
+ // }
66033
+ //
66034
+ // console.log(`Retrying join for ${dialogsToRetry.length} dialogs...`);
66035
+ // await this.processDialogs(dialogsToRetry);
66036
+ // }, 7000);
66037
+ // }
66038
+ //
66039
+ // private async processDialogsInBackground(dialogIds: string[]): Promise<void> {
66040
+ // const BATCH_SIZE = 12;
66041
+ //
66042
+ // console.log(`Starting background processing for ${dialogIds.length} dialogs`);
66043
+ //
66044
+ // for (let i = 0; i < dialogIds.length; i += BATCH_SIZE) {
66045
+ // const batch = dialogIds.slice(i, i + BATCH_SIZE);
66046
+ //
66047
+ // console.log(`Processing batch ${i / BATCH_SIZE + 1}:`, batch);
66048
+ //
66049
+ // await Promise.all(batch.map((id) => this.joinGroupDialog(id)));
66050
+ // console.log(`Batch ${i / BATCH_SIZE + 1} completed.`);
66051
+ //
66052
+ // await new Promise((resolve) => setTimeout(resolve, 1500));
66053
+ // }
66054
+ //
66055
+ // console.log('Background processing complete.');
66056
+ // }
66057
+ //
66058
+ // private async processDialogs(dialogIds: string[]): Promise<void> {
66059
+ // await Promise.all(dialogIds.map((id) => this.joinGroupDialog(id)));
66060
+ // }
66061
+ //
66062
+ // async getDialogs(pagination?: Pagination): Promise<RemoteDialogsDTO> {
66063
+ // let currentPagination: Pagination = pagination || new Pagination();
66064
+ //
66065
+ // const pageNumber = currentPagination.getCurrentPage() || 1;
66066
+ // const perPage = currentPagination.perPage || 100;
66067
+ //
66068
+ // const params = {
66069
+ // created_at: { lt: Date.now() / 1000 },
66070
+ // sort_desc: 'updated_at',
66071
+ // page: pageNumber,
66072
+ // limit: perPage,
66073
+ // type: { in: [2, 3] },
66074
+ // };
66075
+ //
66076
+ // const dialogsDTO: Array<RemoteDialogDTO> = [];
66077
+ // const joinDialogIds: string[] = [];
66078
+ // const qbDialogs: QBGetDialogResult | undefined = await QBGetDialogs(params);
66079
+ //
66080
+ // if (qbDialogs) {
66081
+ // currentPagination = new Pagination(0, perPage);
66082
+ // currentPagination.totalPages = qbDialogs.total_entries / perPage;
66083
+ // currentPagination.setCurrentPage(pageNumber);
66084
+ //
66085
+ // for (const item of qbDialogs.items) {
66086
+ // const qbEntity: QBChatDialog = item;
66087
+ // if (!qbEntity) continue;
66088
+ //
66089
+ // const newDTO: RemoteDialogDTO = await this.getCurrentDialogDTOMapper().toTDO(qbEntity);
66090
+ //
66091
+ // if (newDTO.type === DialogType.group && !this.processedDialogs.has(newDTO.id)) {
66092
+ // this.processedDialogs.add(newDTO.id);
66093
+ //
66094
+ // // Если уже есть в Map — пропускаем, иначе добавляем в joinDialogIds
66095
+ // if (!this.joinStatusMap.has(newDTO.id)) {
66096
+ // this.joinStatusMap.set(newDTO.id, false);
66097
+ // joinDialogIds.push(newDTO.id);
66098
+ // }
66099
+ // }
66100
+ //
66101
+ // dialogsDTO.push(newDTO);
66102
+ // }
66103
+ //
66104
+ // const firstBatch = joinDialogIds.slice(0, 12);
66105
+ // await this.processDialogs(firstBatch);
66106
+ //
66107
+ // const remainingDialogs = joinDialogIds.slice(12);
66108
+ // if (remainingDialogs.length) {
66109
+ // await this.processDialogsInBackground(remainingDialogs);
66110
+ // this.startJoinRetryProcess();
66111
+ // }
66112
+ // }
66113
+ //
66114
+ // return Promise.resolve(new RemoteDialogsDTO(dialogsDTO, currentPagination));
66115
+ // }
65985
66116
  //tested in 0.5.0-beta.10
65986
66117
  // private async processDialogs(dialogIds: string[]): Promise<void> {
65987
66118
  // await Promise.all(dialogIds.map((id) => this.joinGroupDialog(id)));
@@ -66265,35 +66396,6 @@ class RemoteDataSource {
66265
66396
  }
66266
66397
  return Promise.resolve();
66267
66398
  }
66268
- // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars
66269
- async getUser(dto) {
66270
- // Проверяем кэш перед запросом на сервер
66271
- if (this.userCache.has(dto.id)) {
66272
- console.log(`User ${dto.id} found in cache.`);
66273
- return Promise.resolve(this.userCache.get(dto.id));
66274
- }
66275
- const currentItem = await QBUsersGetById(parseInt(dto.id, 10));
66276
- if (currentItem === null || currentItem === undefined) {
66277
- return Promise.reject(new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE));
66278
- }
66279
- let dtoUser;
66280
- try {
66281
- dtoUser = await this.userDTOMapper.toTDO(currentItem);
66282
- }
66283
- catch (e) {
66284
- console.log('problem with:');
66285
- console.log(JSON.stringify(currentItem));
66286
- console.log(e.message);
66287
- console.log(e._description);
66288
- }
66289
- if (dtoUser !== null && dtoUser !== undefined) {
66290
- // Сохраняем пользователя в кэше
66291
- this.userCache.set(dto.id, dtoUser);
66292
- console.log(`User ${dto.id} added to cache.`);
66293
- return Promise.resolve(dtoUser);
66294
- }
66295
- return Promise.reject(new RemoteDataSourceException(NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_MESSAGE, NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_CODE, `not found user with id: ${dto.id} (${dto.full_name})`));
66296
- }
66297
66399
  // async getUser(dto: RemoteUserDTO): Promise<RemoteUserDTO> {
66298
66400
  // const currentItem: QBUser | undefined = await QBUsersGetById(
66299
66401
  // parseInt(dto.id, 10),
@@ -66333,6 +66435,35 @@ class RemoteDataSource {
66333
66435
  // );
66334
66436
  // }
66335
66437
  // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars
66438
+ async getUser(dto) {
66439
+ // Проверяем кэш перед запросом на сервер
66440
+ if (this.userCache.has(dto.id)) {
66441
+ console.log(`User ${dto.id} found in cache.`);
66442
+ return Promise.resolve(this.userCache.get(dto.id));
66443
+ }
66444
+ const currentItem = await QBUsersGetById(parseInt(dto.id, 10));
66445
+ if (currentItem === null || currentItem === undefined) {
66446
+ return Promise.reject(new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE));
66447
+ }
66448
+ let dtoUser;
66449
+ try {
66450
+ dtoUser = await this.userDTOMapper.toTDO(currentItem);
66451
+ }
66452
+ catch (e) {
66453
+ console.log('problem with:');
66454
+ console.log(JSON.stringify(currentItem));
66455
+ console.log(e.message);
66456
+ console.log(e._description);
66457
+ }
66458
+ if (dtoUser !== null && dtoUser !== undefined) {
66459
+ // Сохраняем пользователя в кэше
66460
+ this.userCache.set(dto.id, dtoUser);
66461
+ console.log(`User ${dto.id} added to cache.`);
66462
+ return Promise.resolve(dtoUser);
66463
+ }
66464
+ return Promise.reject(new RemoteDataSourceException(NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_MESSAGE, NOT_FOUND_REMOTE_DATASOURCE_EXCEPTION_CODE, `not found user with id: ${dto.id} (${dto.full_name})`));
66465
+ }
66466
+ // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars
66336
66467
  async getUsers(remoteUsersDTO) {
66337
66468
  const usersDTO = new Array();
66338
66469
  // eslint-disable-next-line no-restricted-syntax
@@ -66343,7 +66474,6 @@ class RemoteDataSource {
66343
66474
  }
66344
66475
  return Promise.resolve(new RemoteUsersDTO(usersDTO, new Pagination()));
66345
66476
  }
66346
- //
66347
66477
  // eslint-disable-next-line class-methods-use-this
66348
66478
  async getAllUsers(pagination,
66349
66479
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -66401,8 +66531,6 @@ class RemoteDataSource {
66401
66531
  }
66402
66532
  return { ResultData: users, PaginationResult: resultPagination };
66403
66533
  }
66404
- //
66405
- //
66406
66534
  // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this,@typescript-eslint/no-unused-vars,@typescript-eslint/ban-ts-comment
66407
66535
  // @ts-ignore
66408
66536
  // eslint-disable-next-line @typescript-eslint/require-await,class-methods-use-this
@@ -66438,9 +66566,15 @@ class RemoteDataSource {
66438
66566
  async typingMessageStart(dialogDTO, senderId) {
66439
66567
  const qbEntity = await this.getCurrentDialogDTOMapper().fromDTO(dialogDTO);
66440
66568
  if (dialogDTO.type === DialogType.group) {
66441
- await QBJoinGroupDialog(dialogDTO.id).catch(() => {
66442
- throw new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);
66443
- });
66569
+ if (!this.joinStatusMap.has(dialogDTO.id)) {
66570
+ await this.joinGroupDialog(dialogDTO.id);
66571
+ }
66572
+ // await QBJoinGroupDialog(dialogDTO.id).catch(() => {
66573
+ // throw new RemoteDataSourceException(
66574
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
66575
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
66576
+ // );
66577
+ // });
66444
66578
  }
66445
66579
  QBSendIsTypingStatus(qbEntity, senderId);
66446
66580
  return Promise.resolve();
@@ -66493,11 +66627,23 @@ class RemoteDataSource {
66493
66627
  qbMessageId = await QBChatSendMessage(dto.recipient_id, qbEntity);
66494
66628
  }
66495
66629
  else {
66496
- await QBJoinGroupDialog(dto.dialogId).catch(() => {
66497
- throw new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE);
66498
- });
66630
+ // await QBJoinGroupDialog(dto.dialogId).catch(() => {
66631
+ // throw new RemoteDataSourceException(
66632
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE,
66633
+ // INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE,
66634
+ // );
66635
+ // });
66636
+ if (!this.joinStatusMap.has(dto.dialogId)) {
66637
+ await this.joinGroupDialog(dto.dialogId);
66638
+ }
66499
66639
  const dialogJid = QB.chat.helpers.getRoomJidFromDialogId(dto.dialogId);
66500
- qbMessageId = await QBChatSendMessage(dialogJid, qbEntity);
66640
+ try {
66641
+ qbMessageId = await QBChatSendMessage(dialogJid, qbEntity);
66642
+ }
66643
+ catch (e) {
66644
+ qbMessageId = undefined;
66645
+ console.log('Error: send message throw: ', parse_stringifyError(e));
66646
+ }
66501
66647
  }
66502
66648
  if (qbMessageId === null || qbMessageId === undefined) {
66503
66649
  return Promise.reject(new RemoteDataSourceException(INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_MESSAGE, INCORRECT_REMOTE_DATASOURCE_DATA_EXCEPTION_CODE));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quickblox-react-ui-kit",
3
- "version": "0.5.0-beta.11",
3
+ "version": "0.5.0-beta.13",
4
4
  "main": "dist/index-ui.js",
5
5
  "types": "dist/index-ui.d.ts",
6
6
  "license": "MIT",
package/src/App.tsx CHANGED
@@ -179,6 +179,11 @@ function App() {
179
179
  data,
180
180
  );
181
181
  await prepareContent().catch();
182
+ currentContext.setSubscribeOnSessionExpiredListener(() => {
183
+ console.timeLog('call OnSessionExpiredListener ... start')
184
+ // logoutHandler();
185
+ console.log('OnSessionExpiredListener ... end');
186
+ });
182
187
  navigate('/desktop-test-mock');
183
188
  }
184
189
  }
@@ -48,9 +48,11 @@ export class Creator {
48
48
 
49
49
  const blobFile = await fetch(imageSrc)
50
50
  .catch(async function () {
51
- const response = await fetch(imageSrc);
51
+ const response = await fetch(imageSrc).catch((reason: any) => {
52
+ console.error('Image fetch error', reason);
53
+ });
52
54
 
53
- if (response.ok) {
55
+ if (response?.ok) {
54
56
  await setBlob(response);
55
57
  }
56
58
  })
@@ -136,13 +136,13 @@ export class DefaultConfigurations {
136
136
  //
137
137
  static getDefaultQBConfig(): QBUIKitConfig {
138
138
  return {
139
- credentials: {
140
- appId: -1,
141
- accountKey: '',
142
- authKey: '',
143
- authSecret: '',
144
- sessionToken: '',
145
- },
139
+ credentials: {
140
+ appId: -1,
141
+ accountKey: '',
142
+ authKey: '',
143
+ authSecret: '',
144
+ sessionToken: '',
145
+ },
146
146
  configAIApi: {
147
147
  AIAnswerAssistWidgetConfig: {
148
148
  smartChatAssistantId: '',
@@ -134,7 +134,13 @@ export class MessageDTOMapper implements IDTOMapper {
134
134
 
135
135
  if (!offValidate) {
136
136
  // original version
137
- MessageDTOMapper.validateQBMessage(qbMessage);
137
+ try {
138
+ MessageDTOMapper.validateQBMessage(qbMessage);
139
+ }catch (e) {
140
+ console.log('Error validating QBChatMessage: ('+JSON.stringify(qbMessage)+')' );
141
+ console.error(e);
142
+ }
143
+
138
144
 
139
145
  dto.id = qbMessage._id;
140
146
  dto.dialogId = qbMessage.chat_dialog_id;