Opened 16 years ago
Last modified 16 years ago
#7267 closed defect
Pagination variables are temporarly shared betweens user sessions in ReportModule — at Initial Version
Reported by: | Owned by: | Matthew Good | |
---|---|---|---|
Priority: | normal | Milestone: | 0.11 |
Component: | report system | Version: | 0.11rc1 |
Severity: | major | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
[6901] has added pagination handling for report. From looking at the code, it adds data attributes ('page', 'limit', 'num_rows', as well as 'asc', 'sort', 'USER') to the class "ReportModule" (see source:/trunk/trac/ticket/report.py@6901#L25 ) . But, AFAIK, only one instance of each "Component" class (of which ReportModule inherits) is shared across all user requests, so I believe that these attributes will be shared across users. Or maybe I'm reading the code wrong…
The risk is low, but unpredictable: it will be a problem when two users request a (different) report at the same time; in that case, the result will be unpredictable.
It also makes it impossible to use the ReportModule.execute_report without first settings the 'limit' attribute (which is why I caught this issue: I had some automated tests that would call execute_report and that suddenly started failing…)
Why not instead add an optional parameter to execute_report instead, that would contain (and return, as attributes) the pagination information ?
I can propose a patch if you want,
Again, maybe I'm wrong and not reading the code correctly…