mongo-adapter: $pull throws on element conditions and empties the array for a regex or date
I maintainer di solito rispondono entro 1 giorno
@mrityunjay-pandey ci sta già lavorando.
Dal 30/10/2026.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 25/100
- Tipo di issue
- Bug
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Ferma
- Stack tecnologico
- mongodb, typescript
- Ambito
- databases
Direzione di ricerca
Start with createTransformFromUpdateFilter, the client-side update helper named in the reproduction, and trace how it handles $pull arguments. Check the existing tests around this helper, if available. Done means element conditions, regular expressions, and dates produce the expected arrays; linked pull request #43328 indicates work is already underway.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Description:
In @rocket.chat/mongo-adapter (the client-side update helper for local collections), $pull treats every object argument as a query on documents. This breaks three kinds of valid MongoDB $pull arguments:
- A condition on the elements themselves (
{ $gte: 20 },{ $in: [10, 30] }) throwsUnrecognized logical operator: $gte. - A regular expression (
/^tmp/) has no keys, so it compiles to an empty filter and removes every element. - A date (
new Date(1)) behaves the same way and also removes every element.
Steps to reproduce:
import { createTransformFromUpdateFilter } from '@rocket.chat/mongo-adapter';
createTransformFromUpdateFilter({ $pull: { scores: { $gte: 20 } } })({ scores: [10, 20, 30] }); // throws
createTransformFromUpdateFilter({ $pull: { tags: /^tmp/ } })({ tags: ['tmp-1', 'keep'] }); // { tags: [] }
createTransformFromUpdateFilter({ $pull: { dates: new Date(1) } })({ dates: [new Date(1), new Date(2)] }); // { dates: [] }
Expected behavior:
As in MongoDB: { scores: [10] }, { tags: ['keep'] } and { dates: [new Date(2)] }.
Actual behavior:
The first call throws, and the other two empty the array.
Server Setup Information:
- Version of Rocket.Chat Server: develop (69a52ce39b)
- Lingua principale
- TypeScript
- Stelle
- 46.5k
- Fork
- 14.1k
- Merge medio
- 1g 21h
- PR unite (30g)
- 381
Preparare l'ambiente
Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.
- Nessun Dockerfile né file Docker Compose
- Ha un modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di RocketChat/Rocket.Chat
-
Mark the empty state busy while a new search loads, like the table */}Forse già presa @aditya25bcy10173-a11y l’ha presa 2 giorni fa. Apertatodo type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
RocketChat/Rocket.Chat#43699 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Timestamp with a time but no timezone shows as 1 January 1970Forse già presa @Sarthak-agrawal-tech l’ha presa 4 giorni fa. Apertatype: bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RocketChat/Rocket.Chat#43637 · 6 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Move this mapping from useQuery's old `select` into a usePaginatedQuery `combine`Forse già presa @aditya25bcy10173-a11y l’ha presa 3 giorni fa. Apertatodo type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
RocketChat/Rocket.Chat#43609 · 4 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
evaluate switching to the other tab when the selected tab's permission is revoked mid-sessionForse già presa @schizophrenicmaniac l’ha presa 4 giorni fa. Apertatodo type: feature
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
RocketChat/Rocket.Chat#43579 · 3 commenti · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
Docs say packages can be installed with `npm` but use unsupported `patch:` URLForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertatype: bug
Difficoltà 1/5 1-3 ore Idoneità per principianti 72/100
RocketChat/Rocket.Chat#43554 · 4 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di RocketChat/Rocket.Chat
Issue simili
-
Bug: Broken RTL / BiDi text rendering when mixing Persian (Farsi) with English or numbersForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertabug
Difficoltà 2/5 Mezza giornata Idoneità per principianti 68/100
amosblomqvist/learnharness#758 ·
I maintainer di solito rispondono entro 2 giorni
-
Change WorkspacesAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
bitfocus/companion-module-renewedvision-propresenter-api#134 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
rcpch/digital-growth-charts-react-component-library#304 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
dsh-market/dsh-market#1210 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
good first issue
Difficoltà 2/5 1-3 ore Idoneità per principianti 86/100
trustjonathan/STUDY-HUB#13 ·