[Bug][Asana] Story, subtask and tag collectors stop at 100 per task; task and user collectors restart on a full last page

Aperta
#9,365 0 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@ShivamSharma43 ci sta già lavorando.

Dal 10/11/2026.

  • #9366 di @ShivamSharma43 — aperta

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

Search before asking
  • I had searched in the issues and found no similar issues.
What happened

The Asana collectors don't page through list endpoints correctly.

  1. collectStory, collectSubtask and collectTag (plugins/asana/tasks/{story,subtask,tag}_collector.go) send limit=100 but have no PageSize and no GetNextPageCustomData, so the ApiCollector makes one request per task and never sends offset. Only the first 100 stories, subtasks and tags of each task are collected. Stories include system events (assignments, section moves, due date changes), so busy tasks go past 100.

  2. collectTask and collectUser do page with offset, but their GetNextPageCustomData returns nil, nil when next_page is null:

if resp.NextPage != nil && resp.NextPage.Offset != "" {
	return resp.NextPage.Offset, nil
}
return nil, nil

nil, nil doesn't end the collection. The collector sets CustomData to nil and requests the next page, and the query then has no offset, so it asks for page 1 again. When the last page is full (100 items) and Asana returns "next_page": null, the collector keeps re-collecting the project from the start and saving the same raw rows again.

From the Asana docs (https://developers.asana.com/docs/pagination): limit must be between 1 and 100, and "If there are no more pages available, next_page will be null and no offset will be provided."

What do you expect to happen

All five collectors follow next_page.offset and stop when next_page is null.

How to reproduce
  • Stories: collect a project with a task that has more than 100 stories. _raw_asana_stories has 100 rows for that task.
  • Tasks: the GetNextPageCustomData above returns nil, nil for a full page with "next_page": null, and fetchPagesSequentially in helpers/pluginhelper/api/api_collector.go only stops on a short page or ErrFinishCollect.
Anything else

Proposed fix (I have a PR ready): a shared getNextAsanaPageOffset that returns api.ErrFinishCollect when next_page is null, and a setAsanaPageQuery that sets limit and offset, used by the task, user, story, subtask and tag collectors.

Version

main

Are you willing to submit PR?
  • Yes I am willing to submit a PR!
Code of Conduct
Lingua principale
Go
Stelle
3.2k
Fork
840
Merge medio
1g 21h
PR unite (30g)
104

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

  • Nessun Dockerfile né file Docker Compose
  • Ha un modello di pull request
  • Nessuna guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di apache/devlake

Tutte le issue di apache/devlake

Issue simili

Altre issue su Go

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.