Skip to content

The app.store.find() method doesn't handle API response pagination #4234

@Lemonn

Description

@Lemonn

Current Behavior

Only the first response from the server is used; pagination is ignored. This is not intuitive, as a calling user would expect that all results are pushed to the store, not only the first page.

Steps to Reproduce

Request a larger batch of users than the pagination limit:

app.store.find('users', [1,2,3,...], {
          include: 'groups'
        });

Expected Behavior

The find method should honor pagination.

Screenshots

Image Image

Environment

Flarum: 1.8.10
PHP: 8.3.22
MySQL: 10.5.29-MariaDB-ubu2004
Queue Driver: sync
Session Driver: file

Output of php flarum info

Flarum core: 1.8.10
PHP version: 8.3.22
MySQL version: 10.5.29-MariaDB-ubu2004
Loaded extensions: Core, date, libxml, pcre, zlib, filter, hash, json, random, readline, Reflection, SPL, session, ctype, curl, dom, fileinfo, gd, gmp, iconv, intl, mbstring, openssl, PDO, standard, SimpleXML, sodium, tokenizer, xml, xmlwriter, zip, exif, mysqlnd, Phar, pdo_mysql, uuid, imagick, Zend OPcache
+----------------------+----------+--------+
| Flarum Extensions    |          |        |
+----------------------+----------+--------+
| ID                   | Version  | Commit |
+----------------------+----------+--------+
| flarum-flags         | v1.8.2   |        |
| flarum-approval      | v1.8.2   |        |
| flarum-tags          | v1.8.4   |        |
| lemonn-user-map       | dev-main |        |
| flarum-suspend       | v1.8.4   |        |
| flarum-subscriptions | v1.8.1   |        |
| flarum-sticky        | v1.8.2   |        |
| flarum-statistics    | v1.8.1   |        |
| flarum-mentions      | v1.8.5   |        |
| flarum-markdown      | v1.8.1   |        |
| flarum-lock          | v1.8.2   |        |
| flarum-likes         | v1.8.1   |        |
| flarum-lang-english  | v1.8.0   |        |
| flarum-emoji         | v1.8.1   |        |
| flarum-bbcode        | v1.8.0   |        |
+----------------------+----------+--------+
Base URL: http://192.168.178.79:8000
Installation path: /opt/flarum
Queue driver: sync
Session driver: file
Mail driver: mail
Debug mode: ON

Possible Solution

No response

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions