diff --git a/packages/nc-gui/components/feed/Changelog/Item.vue b/packages/nc-gui/components/feed/Changelog/Item.vue index 71ca929981..608b449558 100644 --- a/packages/nc-gui/components/feed/Changelog/Item.vue +++ b/packages/nc-gui/components/feed/Changelog/Item.vue @@ -64,7 +64,7 @@ const renderedText = computedAsync(async () => {
-
{
- diff --git a/packages/nc-gui/components/feed/View.vue b/packages/nc-gui/components/feed/View.vue index ad70e8c375..13dc950505 100644 --- a/packages/nc-gui/components/feed/View.vue +++ b/packages/nc-gui/components/feed/View.vue @@ -76,5 +76,3 @@ const tabs: Array<{
- - diff --git a/packages/nocodb/src/controllers/utils.controller.ts b/packages/nocodb/src/controllers/utils.controller.ts index 36ff243553..694ac02161 100644 --- a/packages/nocodb/src/controllers/utils.controller.ts +++ b/packages/nocodb/src/controllers/utils.controller.ts @@ -169,13 +169,13 @@ export class UtilsController { } @UseGuards(PublicApiLimiterGuard) - @Get('/api/v1/feed') + @Get('/api/v2/feed') async feed(@Request() req: NcRequest) { return await this.utilsService.feed(req); } @UseGuards(PublicApiLimiterGuard) - @Get('/api/v1/new-feed') + @Get('/api/v2/new-feed') async newFeed(@Request() req: NcRequest) { return await this.utilsService.getLatestFeed(req); } diff --git a/packages/nocodb/src/schema/swagger.json b/packages/nocodb/src/schema/swagger.json index 74911ce560..e630dac986 100644 --- a/packages/nocodb/src/schema/swagger.json +++ b/packages/nocodb/src/schema/swagger.json @@ -16015,7 +16015,7 @@ ] } }, - "/api/v1/new-feed": { + "/api/v2/new-feed": { "get": { "summary": "Get Feed", "operationId": "utils-feed", @@ -16042,7 +16042,7 @@ ] } }, - "/api/v1/feed": { + "/api/v2/feed": { "get": { "summary": "Get Feed", "operationId": "utils-feed", diff --git a/packages/nocodb/src/services/utils.service.ts b/packages/nocodb/src/services/utils.service.ts index 3287b8f4f0..404b832eb8 100644 --- a/packages/nocodb/src/services/utils.service.ts +++ b/packages/nocodb/src/services/utils.service.ts @@ -1,5 +1,5 @@ import process from 'process'; -import { Injectable } from '@nestjs/common'; +import { Injectable, Logger } from '@nestjs/common'; import axios from 'axios'; import { compareVersions, validate } from 'compare-versions'; import { ViewTypes } from 'nocodb-sdk'; @@ -75,6 +75,8 @@ interface AllMeta { @Injectable() export class UtilsService { + protected logger = new Logger(UtilsService.name); + constructor(protected readonly configService: ConfigService) {} lastSyncTime = dayjs(); @@ -497,7 +499,7 @@ export class UtilsService { try { return JSON.parse(cachedData); } catch (e) { - console.log(e); + this.logger.error(e?.message, e); } } @@ -520,7 +522,7 @@ export class UtilsService { }, ); } catch (e) { - console.log(e); + this.logger.error(e?.message, e); return []; } @@ -551,33 +553,30 @@ export class UtilsService { page: 1, missedItems: 0, }; - while (!utils.found) { - const feed = await this.feed({ - query: { - type: 'all', - page: utils.page.toString(), - per_page: '100', - }, - } as unknown as NcRequest); + const feed = await this.feed({ + query: { + type: 'all', + page: utils.page.toString(), + per_page: '100', + }, + } as unknown as NcRequest); + + if (!feed || !feed?.length) { + return 0; + } - if (!feed || !feed?.length) { + for (const item of feed) { + if (item['Published Time'] === last_published_at) { + utils.found = true; break; } + utils.missedItems++; + } - for (const item of feed) { - if (item['Published Time'] === last_published_at) { - utils.found = true; - break; - } - - utils.missedItems++; - } - - if (!utils.found) { - utils.page++; - } + if (utils.found) { + return utils.missedItems; } - return utils.missedItems; + return `${utils.missedItems}+`; } }