Deleting flag fails with "cyclic object value"
- Dominant language
- No language data
- Stars
- 0
- Forks
- 0
- PR merge metrics
- No merged PRs in 30d
Description
## Bug Report
**Current Behavior**
When dismissing a flag, the operation sometimes fails before sending the XHR request, with the following error shown in console:
```
Uncaught (in promise) TypeError: cyclic object value
request request.js:173
a request.js:23
nrWrapper 5158:4
r 5158:4
s request.js:22
request Application.js:360
dismissFlag addFlagsToPosts.js:45
handleEvent render.js:888
t 5158:4
nrWrapper 5158:4
```
**Steps to Reproduce**
I don't have a way to reproduce it consistently, it seems to happen only to me on my forum and not always.
What I do is just clicking "Delete flag". Refreshing the page sometimes fixes the issue, sometimes not.
**Expected Behavior**
The flag should be deleted without errors.
**Environment**
- Flarum version: 1.0.4
- Website URL: not relevant
- Webserver: not relevant
- Hosting environment: not relevant
- PHP version: not relevant
- Browser: Firefox 91 on desktop. Not seeing this with Firefox on mobile
```
Flarum core 1.0.4
PHP version: [redacted]
Loaded extensions: Core, date, libxml, openssl, pcre, zlib, filter, hash, pcntl, Reflection, SPL, sodium, session, standard, mysqlnd, PDO, xml, calendar, ctype, curl, dom, mbstring, fileinfo, ftp, gd, gettext, iconv, imagick, json, exif, mysqli, newrelic, pdo_mysql, Phar, posix, readline, shmop, SimpleXML, sockets, sysvmsg, sysvsem, sysvshm, tokenizer, wddx, xmlreader, xmlwriter, xsl, zip, Zend OPcache
+-------------------------------------+------------+------------------------------------------+
| Flarum Extensions | | |
+-------------------------------------+------------+------------------------------------------+
| ID | Version | Commit |
+-------------------------------------+------------+------------------------------------------+
| flarum-flags | v1.0.0 | |
| flarum-suspend | v1.0.0 | |
| flarum-bbcode | v1.0.0 | |
| flarum-tags | v1.0.3 | |
| flarum-approval | v1.0.0 | |
| flarum-likes | v1.0.0 | |
| flarum-mentions | v1.0.0 | |
| the-turk-flamoji | 1.0.2 | |
| the-turk-diff | 1.1.1 | |
| fibraclick-italian | dev-master | |
| fof-amazon-affiliation | 1.0.0 | 79191156528c4d7ba7282b6a1c3fcfb66cd673a1 |
| v17development-seo | v1.8.0 | |
| fof-user-bio | 1.0.0 | |
| fof-split | 1.0.0 | d405a2139c1a677550d8eafbbfdec5a644faa774 |
| fof-polls | 1.0.3 | |
| fof-pages | 1.0.1 | |
| fof-oauth | 1.0.1 | |
| fof-nightmode | 1.0.0 | |
| fof-merge-discussions | 1.0.0 | |
| fof-links | 1.0.0 | |
| fof-disposable-emails | 1.0.0 | |
| flarum-subscriptions | v1.0.0 | |
| flarum-sticky | v1.0.0 | |
| flarum-statistics | v1.0.0 | |
| flarum-markdown | v1.0.1 | f7827822606600b85bef094f80b19081e63b3731 |
| flarum-lock | v1.0.0 | |
| flarum-lang-english | v1.0.0 | |
| flarum-emoji | v1.0.0 | |
| clarkwinkelmann-post-permissions | 1.0.0 | |
| clarkwinkelmann-group-list | 1.0.0 | |
| clarkwinkelmann-comicsans | 1.0.0 | |
| clarkwinkelmann-circle-groups | 1.0.0 | |
| fibraclick-upload | dev-master | |
| fibraclick-tweaks | dev-master | |
| clarkwinkelmann-first-post-approval | 1.0.0 | |
| afrux-forum-widgets-core | v0.1.3 | |
| sycho-move-posts | v0.1.5 | |
| clarkwinkelmann-who-read | 1.4.0 | |
+-------------------------------------+------------+------------------------------------------+
[...]
Debug mode: off
```
Contributor guide
Research direction
Start with the dismissFlag path in addFlagsToPosts.js:45, then trace the request through Application.js:360 and request.js:173. Reproduce the intermittent Firefox failure if possible and inspect the request payload handling; done means clicking Delete flag consistently completes the XHR without the cyclic object value error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100