Endpoint de api-ui nao esta trazendo tasks de nivel organization

Description

PROBLEMA

  • Endpoint de api-ui nao esta trazendo tasks de nivel organization
  • Como exemplo, quando uma nova tenant eh criada, o activity management nao esta notificando no icone da plataforma.
  • Mesmo vale para a lista de tasks
    image-20240527-134108.png
  • Segue video de evidencia: https://jam.dev/c/072ded41-22bd-4bf7-86bd-c0f48bfaafd1
  • CURL de buscas de tasks:
  • curl 'https://totvssenuablade.qarol.ai/api-ui/organization-tasks/query' \
      -H 'accept: application/json, text/plain, */*' \
      -H 'accept-language: en-US,en;q=0.9' \
      -H 'authorization: 7588cf5a02ca4ff19d48e18caf562271' \
      -H 'content-type: application/json' \
      -H 'cookie: _ga=GA1.1.1612114313.1716810606; authorization-lowgamustenant=adb5a260bf7a444296b0bc8fb98b2ea6; _ga_TJR07JH85H=GS1.1.1716816751.2.1.1716817002.0.0.0' \
      -H 'origin: https://totvssenuablade.qarol.ai' \
      -H 'priority: u=1, i' \
      -H 'referer: https://totvssenuablade.qarol.ai/carol-org/tasks/activity?p=1&ps=25&filters=%5B%7B%22dateUpdated%22:%5B%22after%22,%222024-05-26T13:39:12.160Z%22%5D%7D%5D' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: cors' \
      -H 'sec-fetch-site: same-origin' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      --data-raw '{"indexType":"MASTER","scrollable":false,"pageSize":25,"offset":0,"sortBy":"lastUpdated","sortOrder":"DESC","filters":{"hideInternal":true,"startUpdatedDate":"2024-05-26T13:39:12.160Z","endUpdatedDate":null}}' ;
    curl 'https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.min.js' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'Referer: https://totvssenuablade.qarol.ai/' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      -H 'sec-ch-ua-platform: "macOS"' ;
    curl 'https://totvssenuablade.qarol.ai/carol-org/assets/images/favicon-org.png' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'Referer: https://totvssenuablade.qarol.ai/carol-org/tasks/activity?p=1&ps=25&filters=%5B%7B%22dateUpdated%22:%5B%22after%22,%222024-05-26T13:39:12.160Z%22%5D%7D%5D' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      -H 'sec-ch-ua-platform: "macOS"' ;
    curl 'https://totvssenuablade.qarol.ai/carol-org/assets/images/favicon-org.png' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'Referer: https://totvssenuablade.qarol.ai/carol-org/tasks/activity?p=1&ps=25&filters=%5B%7B%22dateUpdated%22:%5B%22after%22,%222024-05-26T13:39:12.160Z%22%5D%7D%5D' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      -H 'sec-ch-ua-platform: "macOS"' ;
    curl 'https://cdn.jsdelivr.net/npm/daterangepicker/daterangepicker.css' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'Referer: https://totvssenuablade.qarol.ai/' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      -H 'sec-ch-ua-platform: "macOS"' ;
    curl 'data:image/svg+xml;charset=utf8,<svg xmlns="http://www.w3.org/2000/svg" width="100" height="100"><path fill="%23F5F6F7" d="M10 30h80L50 70z"/></svg>' \
      -H 'Referer;' \
      -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' ;
    curl 'https://totvssenuablade.qarol.ai/api-ui/organization-tasks/query' \
      -H 'accept: application/json, text/plain, */*' \
      -H 'accept-language: en-US,en;q=0.9' \
      -H 'authorization: 7588cf5a02ca4ff19d48e18caf562271' \
      -H 'content-type: application/json' \
      -H 'cookie: _ga=GA1.1.1612114313.1716810606; authorization-lowgamustenant=adb5a260bf7a444296b0bc8fb98b2ea6; _ga_TJR07JH85H=GS1.1.1716816751.2.1.1716817153.0.0.0' \
      -H 'origin: https://totvssenuablade.qarol.ai' \
      -H 'priority: u=1, i' \
      -H 'referer: https://totvssenuablade.qarol.ai/carol-org/tasks/activity?p=1&ps=25&sort=dateUpdated&order=DESC&filters=%5B%5D' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: cors' \
      -H 'sec-fetch-site: same-origin' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      --data-raw '{"indexType":"MASTER","scrollable":false,"pageSize":25,"offset":0,"sortBy":"lastUpdated","sortOrder":"DESC","filters":{"hideInternal":true}}' ;
    curl 'https://totvssenuablade.qarol.ai/api-ui/organization-tasks/query' \
      -H 'accept: application/json, text/plain, */*' \
      -H 'accept-language: en-US,en;q=0.9' \
      -H 'authorization: 7588cf5a02ca4ff19d48e18caf562271' \
      -H 'content-type: application/json' \
      -H 'cookie: _ga=GA1.1.1612114313.1716810606; authorization-lowgamustenant=adb5a260bf7a444296b0bc8fb98b2ea6; _ga_TJR07JH85H=GS1.1.1716816751.2.1.1716817153.0.0.0' \
      -H 'origin: https://totvssenuablade.qarol.ai' \
      -H 'priority: u=1, i' \
      -H 'referer: https://totvssenuablade.qarol.ai/carol-org/tasks/activity?p=1&ps=25&sort=dateUpdated&order=DESC&filters=%5B%5D' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: cors' \
      -H 'sec-fetch-site: same-origin' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      --data-raw '{"indexType":"MASTER","scrollable":false,"pageSize":20,"offset":0,"sortBy":"lastUpdated","sortOrder":"DESC","filters":{"hideInternal":true,"taskTypes":["DELETE_TENANT","CREATE_TENANT"],"startUpdatedDate":"2024-05-24T03:00:00Z","endUpdatedDate":"2024-05-27T13:39:17Z"}}' ;
    curl 'https://totvssenuablade.qarol.ai/carol-org/assets/images/favicon-org.png' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'Referer: https://totvssenuablade.qarol.ai/carol-org/tasks/activity?p=1&ps=25&sort=dateUpdated&order=DESC&filters=%5B%5D' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' \
      -H 'sec-ch-ua-platform: "macOS"' ;
    curl 'https://www.google-analytics.com/g/collect?v=2&tid=G-TJR07JH85H&gtm=45je45m0v885587034za200zb898648231&_p=1716816999002&gcd=13l3l3l3l1&npa=0&dma=0&cid=1612114313.1716810606&ul=en-us&sr=1920x1080&uaa=x86&uab=64&uafvl=Google%2520Chrome%3B125.0.6422.78%7CChromium%3B125.0.6422.78%7CNot.A%252FBrand%3B24.0.0.0&uamb=0&uam=&uap=macOS&uapv=13.6.6&uaw=0&are=1&frm=0&pscdl=noapi&_eu=AEA&_s=3&dl=https%3A%2F%2Ftotvssenuablade.qarol.ai%2Fcarol-org%2Ftasks%2Factivity%3Fp%3D1%26ps%3D25%26filters%3D%255B%257B%2522dateUpdated%2522%3A%255B%2522after%2522%2C%25222024-05-26T13%3A39%3A12.160Z%2522%255D%257D%255D&dr=https%3A%2F%2Ftotvssenuablade.qarol.ai%2Fcarol-org%2Fadmin%2Ftenants&sid=1716816751&sct=2&seg=1&dt=totvs%20-%20Activity%20Management%20%7C%20Carol&en=page_view&_et=17719&tfd=160210' \
      -X 'POST' \
      -H 'accept: */*' \
      -H 'accept-language: en-US,en;q=0.9' \
      -H 'content-length: 0' \
      -H 'origin: https://totvssenuablade.qarol.ai' \
      -H 'priority: u=4, i' \
      -H 'referer: https://totvssenuablade.qarol.ai/' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: no-cors' \
      -H 'sec-fetch-site: cross-site' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36' ;
    curl 'https://www.google-analytics.com/g/collect?v=2&tid=G-TJR07JH85H&gtm=45je45m0v885587034za200zb898648231&_p=1716816999002&gcd=13l3l3l3l1&npa=0&dma=0&cid=1612114313.1716810606&ul=en-us&sr=1920x1080&uaa=x86&uab=64&uafvl=Google%2520Chrome%3B125.0.6422.78%7CChromium%3B125.0.6422.78%7CNot.A%252FBrand%3B24.0.0.0&uamb=0&uam=&uap=macOS&uapv=13.6.6&uaw=0&are=1&frm=0&pscdl=noapi&_eu=AEA&_s=4&dl=https%3A%2F%2Ftotvssenuablade.qarol.ai%2Fcarol-org%2Ftasks%2Factivity%3Fp%3D1%26ps%3D25%26sort%3DdateUpdated%26order%3DDESC%26filters%3D%255B%255D&dr=https%3A%2F%2Ftotvssenuablade.qarol.ai%2Fcarol-org%2Ftasks%2Factivity%3Fp%3D1%26ps%3D25%26filters%3D%255B%257B%2522dateUpdated%2522%3A%255B%2522after%2522%2C%25222024-05-26T13%3A39%3A12.160Z%2522%255D%257D%255D&sid=1716816751&sct=2&seg=1&dt=totvs%20-%20Activity%20Management%20%7C%20Carol&en=page_view&_et=5242&tfd=165454' \
      -X 'POST' \
      -H 'accept: */*' \
      -H 'accept-language: en-US,en;q=0.9' \
      -H 'content-length: 0' \
      -H 'origin: https://totvssenuablade.qarol.ai' \
      -H 'priority: u=4, i' \
      -H 'referer: https://totvssenuablade.qarol.ai/' \
      -H 'sec-ch-ua: "Google Chrome";v="125", "Chromium";v="125", "Not.A/Brand";v="24"' \
      -H 'sec-ch-ua-mobile: ?0' \
      -H 'sec-ch-ua-platform: "macOS"' \
      -H 'sec-fetch-dest: empty' \
      -H 'sec-fetch-mode: no-cors' \
      -H 'sec-fetch-site: cross-site' \
      -H 'user-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/125.0.0.0 Safari/537.36'
  • Problema ocorrendo em produção, consulta no PG mostrando ter tasks para a org totvstechfin:
SELECT *
FROM task
where task_type = 'CREATE_TENANT'
and tenant_id in (select replace(id::text,'-','') from organization o where name in ('totvstechfin'))
LIMIT 10

image-20240603-171614.png

image-20240603-171644.png

PASSOS PARA REPRODUZIR

  • Accessar a plataforma como orgAdmin
  • Criar uma nova tenant
  • Observar o icone de activity management
  • Acessar o Activity management
  • Checar chamadas de api-ui

COMPORTAMENTO ESPERADO

  • Endpoint de api-ui deve trazer as tasks de nivel organization

Activity

Automation for Jira 5 June 2024, 15:01 Jira Internal Users

Esta issue foi automaticamente movida para WAITING DEPLOY, pois o PR foi mergeado na branch master no Github.

Automation for Jira 5 June 2024, 15:00 Jira Internal Users

Esta issue foi automaticamente movimentada para REVIEW, pois o PR (não DRAFT e não WIP) foi criado no Github.

fix: https://totvsideia.atlassian.net/browse/CAPL-5998#icft=CAPL-5998 organization tasks query

Automation for Jira 5 June 2024, 14:58 Jira Internal Users

@Robson Thanael Poffo ,

@Geny Isam Hamud Herrera ,
Esta issue foi planejada para ser entregue até 2024-06-07. Você pode confirmar consultando o campo Due Date desta issue.

Datas já planejadas para esta issue: 2024-06-07

Se o campo External Issue Link estiver preenchido com o link de uma issue válida no Jira Produção o cliente também será notificado no Jira Produção.