Skip to content

Fix posting comments before the initial load has run#9614

Merged
andreslucena merged 4 commits intodecidim:developfrom
mainio:fix/9485
Sep 15, 2022
Merged

Fix posting comments before the initial load has run#9614
andreslucena merged 4 commits intodecidim:developfrom
mainio:fix/9485

Conversation

@ahukkanen
Copy link
Copy Markdown
Contributor

🎩 What? Why?

The comments specs are currently flaky as described at #9485.

There are two problems with this:

  • The polling is actually started before the initial load gives its response due to the way the success hook is defined currently
  • The comments are allows posting a comment before the initial load has run, so let's disable the comments element during the initial load

The second issue is particularly problematic during the tests as it finds the comments are already before the initial load has run. This causes the comment posting response to update the comments count correctly while the initial load is still running. After the comments posting response is handled, the initial load is handled because of which the comments count is unexpected as it is the state that it was before the new comment was posted.

Hopefully this makes sense but anyways, it should fix the flaky comments specs.

📌 Related Issues

Link your PR to an issue

Testing

As described at #9485:

$ cd decidim-accountability
$ for i in {1..20}; do bundle exec rspec spec/system/comments_spec.rb[1:5:4:1] || break; done 

@ahukkanen ahukkanen added module: comments type: fix PRs that implement a fix for a bug labels Jul 26, 2022
@ahukkanen ahukkanen mentioned this pull request Jul 27, 2022
12 tasks
Copy link
Copy Markdown
Member

@andreslucena andreslucena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After multiple reruns on these last couple of days, I couldn't reproduce the flaky on this branch. Seems like it's fixed indeed. Thanks for the PR! 👏🏽

@andreslucena andreslucena merged commit 2aecbb1 into decidim:develop Sep 15, 2022
@ahukkanen ahukkanen deleted the fix/9485 branch September 15, 2022 08:37
entantoencuanto added a commit that referenced this pull request Sep 15, 2022
* develop: (24 commits)
  Add develop index to the documentation (#9666)
  Fix initiatives components (#9633)
  Fix conference speaker avatars (#9643)
  Update `rokroskar/workflow-run-cleanup-action` GitHub action to v0.3.3 (#9750)
  Fix character counter for the WYSIWYG editor (#9680)
  Fix posting comments before the initial load has run (#9614)
  Fix parallel tests port in use (#9661)
  Split parallel test coverage reports into their own folders (#9686)
  Improve admin panel user experience regarding title links and order of actions (#9496)
  Fix title and description too long in initiatives spec sometimes (#9648)
  Fix API GraphiQL system spec with newer ChromeDriver (#9642)
  Add missing character on code block (#9798)
  Fix hidden error messages on the registration form (#9625)
  Add documentation about configuring ActiveStorage / dynamic file uploads (#9777)
  Add documentation section about customizing cells (#9622)
  Fix hashtags not recognized at the beginning of the string (#9616)
  Fix version pages showing a HTTP 500 error when the version does not exist (#9615)
  Fix multitenant organizations stats cache (#9605)
  Prevent the account edit route through Devise (#9611)
  Fix iframe disabling producing invalid HTML (#9685)
  ...
eliegaboriau pushed a commit to eliegaboriau/decidim that referenced this pull request Oct 25, 2022
* Fix posting comments before the initial load has run

* Add missing semicolon

* Fix and update the comments component Jest tests
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module: comments type: fix PRs that implement a fix for a bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Flaky spec on comments_examples.rb

2 participants