fix(filter): accepte les items tableau (lignes xlsx/csv) - #492
Merged
Merged
Conversation
…_wrapped
Le composant Filter utilisait LokiJS qui n'accepte que des objets : un item
tableau (ex. une ligne d'un xlsx/csv : [c1,c2,...]) était rejeté à l'insertion
(erreurs 'Object cannot be null' / 'Document needs to be an object').
- filterRawItems / workWithFragments : les items tableau sont enveloppés dans
{ _wrapped: item } avant collection.insert
- filter : dé-enveloppe avant l'évaluation $where et dans le résultat
- Tests : filterRawItems accepte un tableau de tableaux sans erreur ; cas find
simple avec wrapper
Validé en local avec le fichier DATAPLAYERS 08_2026.xlsx : les 16 lignes non
vides du xlsx sont filtrées (this.length>0), les 984 lignes vides exclues,
0 erreur d'insertion. Objets classiques inchangés.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Résumé
Le composant Filter rejetait les items tableau (ex. une ligne d'un xlsx/csv :
[c1,c2,...]) car LokiJS n'accepte que des objets → erreurs « Object cannot benull » / « Document needs to be an object » dans le résultat.
Cause
collection.insert(tableau)est interprété par Loki comme un lot (batch) :il itère chaque élément (
null,"SOLIS", ...) et tente de les insérerindividuellement → échec.
Correctif
filterRawItems/workWithFragments: les items tableau sont enveloppés dans{ _wrapped: item }avantcollection.insert(objet unique insérable).filter: dé-enveloppe avant l'évaluation$whereet dans le résultat.Validation
DATAPLAYERS 08_2026.xlsx, workflow upload → valueFromPath0.data→ filter$where: this.length>0) : les 16 lignes non vides sontfiltrées, les 984 lignes vides exclues, 0 erreur d'insertion.
Release : bump
v0.11.15+ CHANGELOG.