removeParagraphs() API not always working

Aperta
#544 4 commenti 0 reazioni 1 assegnatario Vedi su GitHub

@EduardMe ci sta già lavorando.

Dal 14/3/2024.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

bug

Checks

  • I confirm I have restarted NotePlan and this problem still persists.
  • Is this a repeatable problem?

Describe the bug
Sometimes this line doesn't work (from jgclark.Filer/src/moveItems.js):
note.removeParagraphs(parasInBlock)

I cannot see any pattern to when this doesn't happen.
Note that I have added some logic now to flag up when this happens, by testing the number of lines in note before and after this call. See this example:

Plugin Console Log
This is the output from 3 successive examples of calling /moveParas on the same single line in the same note:

Executing function 'moveParasToTomorrow'
2024-03-14 23:33:33 | DEBUG | jgclark.Filer v1.1.5 :: moveParas: move current para only
2024-03-14 23:33:33 | DEBUG | jgclark.Filer v1.1.5 :: -> bottom of note, line 9
2024-03-14 23:33:33 | DEBUG | jgclark.Filer v1.1.5 :: - Removing 1 paras from original origNote (which had 33 paras)
Executing function 'moveParasToTomorrow'
2024-03-14 23:33:43 | DEBUG | jgclark.Filer v1.1.5 :: moveParas: move current para only
2024-03-14 23:33:43 | DEBUG | jgclark.Filer v1.1.5 :: -> bottom of note, line 10
2024-03-14 23:33:43 | DEBUG | jgclark.Filer v1.1.5 :: - Removing 1 paras from original origNote (which had 32 paras)
2024-03-14 23:33:43 🥺 WARN🥺 jgclark.Filer v1.1.5 ::   - WARNING: After delete there are 32 paragraphs
Executing function 'moveParasToTomorrow'
2024-03-14 23:35:07 | DEBUG | jgclark.Filer v1.1.5 :: moveParas: move current para only
2024-03-14 23:35:07 | DEBUG | jgclark.Filer v1.1.5 :: -> bottom of note, line 10
2024-03-14 23:35:07 | DEBUG | jgclark.Filer v1.1.5 :: - Removing 1 paras from original origNote (which had 32 paras)

Note that I have deliberately left good time between calls to mean it shouldn't be a caching issue.

Additional context
This has been happening a few times a week for me for at least a year.

@EduardMe is there anything more I can do to help you figure out what's causing this?

Lingua principale
JavaScript
Stelle
204
Fork
82
Merge medio
22h 27m
PR unite (30g)
3

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di NotePlan/plugins

Tutte le issue di NotePlan/plugins

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.