flarum / flarum/framework

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

Open
#4,234 0 comments 0 reactions 0 assignees View on GitHub
type/bug
Dominant language
PHP
Stars
6.7k
Forks
883
Avg merge
15h 16m
Merged PRs (30d)
73

Description

### 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:

```js
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_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.