moebooru / moebooru

Moebooru, a fork of danbooru1 that has been heavily modified
ISC License
525 stars 79 forks source link

Tag completion js sometimes prevents tag script to show "post updated" #21

Closed fireattack closed 8 years ago

fireattack commented 9 years ago

Steps to reproduce:

  1. Open yande.re
  2. Find "recent tags" key in local storage, replace the content with
"0`rating:s` 0`s` 0`siro` 0`test` 0`pool:3749` 0`limit:100` 0`order:id` 0`user:fireattack` 0`holds:only` 1`goto-p` 0`seifuku` 1`karory` 0`shiro` 5`shusseki_bangou_26` 5`august` 0`detexted` 1`xxzero` 0`user:donicila` 0`yukie` 0`order:score` 1`sesena_yau` 0`order:m_pixels_desc` 3`prism_recollection` 0`nakahara` 6`color_issue` 1`naruko_hanaharu` 0`parent:317352` 0`tagme` 1`misaki_kurehito` 4`kanou_meguri` 4`asasaka_meguri` 3`haiyore!_nyaruko-san` 0`parent:317117` 3`touhou` 4`flandre_scarlet` 0`parent:256804` 5`type-moon` 1`ts_mix` 0`taka` 3`the_idolm@ster` 0`user:twinsenzw` 3`saenai_heroine_no_sodatekata` 0`thighhighs` 0`disc_cover` 4`aki_tomoya` 0`takase_tomoaki` 0`sawamura_spencer_eriri` 6`binding_discoloration` 0`hyoudou_michiru` 0`kasumigaoka_utaha` 0`katou_megumi` 0`bathing` "
  1. Open https://yande.re/post?tags=s (to avoid tag vandalism)
  2. Change to Apply tag script mode.
  3. Input "s " (include the space, you really need to do this by hand)
  4. Apply to several images

Console will throw (Chrome):

Uncaught String doesn't end in separator
nrWrapper @ post?tags=s:6

Or Firefox:

04:08:02.237 uncaught exception: Unparsable cached tag: '0`'1 <unknown>

And the "post updated" will never show up. However, the posts are actually updated.

If you refresh the page, and apply scripts to images instantly, it would work flawlessly. So obviously the tag completion pop-up during keying in the scripts plays a role (and it makes sense since that exception message is from this tag_completion.js file)

fireattack commented 9 years ago

this one is still bugged.

nanaya commented 8 years ago

Chrome somehow modifies the trailing space if edited using the resource tab. You can check by running

localStorage.getItem('recent_tags')[localStorage.getItem('recent_tags').length - 1] === ' '

Whereas the problem doesn't happen if I set the local storage data using localStorage.setItem('recent_tags', <the recent tags value>). Please check if you're still having the problem and hopefully a different way to reproduce it.

fireattack commented 8 years ago

Seems fixed right now!