diff options
| author | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-23 17:16:51 +0300 |
|---|---|---|
| committer | Yuriy Andamasov <yuriy@vyos.io> | 2026-05-23 17:16:51 +0300 |
| commit | e5fbde8bb9b21d264f71f25881b44db1af3d03c6 (patch) | |
| tree | 05201cac56a6d3b9c07e7c6644f74d0d86be7801 /src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php | |
| parent | 011eec12f9176a6a8b8d8b9133bc00107a7855c0 (diff) | |
| download | phorge-elasticsearch-modern-e5fbde8bb9b21d264f71f25881b44db1af3d03c6.tar.gz phorge-elasticsearch-modern-e5fbde8bb9b21d264f71f25881b44db1af3d03c6.zip | |
Engine: fix negative pagination bounds and _ts accumulation
Two correctness bugs surfaced by CR / Phase 0, both inherited from
the bundled PhabricatorElasticFulltextStorageEngine pattern:
1. executeSearch() did not validate that $offset / $limit were
non-negative. PHP's (int) cast on a negative string yields a
negative int, which would be passed unchecked to Elasticsearch.
Add an explicit non-negative check before the existing upper-
bound (offset + limit > 10000) check.
2. reindexAbstractDocument()'s relationship-data loop assigned the
'_ts' field unconditionally instead of accumulating. For multi-
valued relationships (multiple authorPHID, projectPHID, etc.
entries on the same doc), only the last timestamp survived.
Change to array-append, parallel to the PHID array.
Both fixes diverge from the bundled engine; bundled retains the
faithful-but-broken behavior. Worth fixing in this extension since
we control the wire format.
🤖 Generated by [robots](https://vyos.io)
Diffstat (limited to 'src/__tests__/VyOSElasticModernFulltextStorageEngineTestCase.php')
0 files changed, 0 insertions, 0 deletions
