Project

General

Profile

Bug #23290

React + Turbolinks integration break when submitting forms

Added by Avi Sharvit almost 2 years ago. Updated over 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
JavaScript stack
Target version:
-
Difficulty:
Triaged:
No
Bugzilla link:

Description

In the react-engine, we listen to turbolinks to clean all the react components when moving between pages:
https://github.com/theforeman/foreman/blob/develop/webpack/assets/javascripts/react_app/common/MountingService.js#L15

When performing form-submit (edit host, save), the event isn't triggering and we got the same components mounted twice into the dom.

For example:
go to hosts > click edit > click submit > click the breadcrumb sibling selector and pick another host.
its lands in another_host/edit because it uses the breadcrumb-bar from the previews mounting.


Related issues

Related to Foreman - Bug #24320: Unable to provision on Vmware, no storage data submittedClosed
Copied to Foreman - Bug #24345: Breadcrumbs isn't refreshed properly after visiting host edit formClosed

Associated revisions

Revision b976723b (diff)
Added by Avi Sharvit over 1 year ago

Fixes #23290 - Unmount components before dom-update

  • provide core `tfm.reactMounter.unmountComponents` function
  • unmount components before saving host and manually update the dom with
    jquery

History

#1 Updated by The Foreman Bot almost 2 years ago

  • Status changed from New to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/5462 added

#2 Updated by Avi Sharvit over 1 year ago

  • Triaged set to No
  • Legacy Backlogs Release (now unused) set to 330

#3 Updated by Avi Sharvit over 1 year ago

  • % Done changed from 0 to 100
  • Status changed from Ready For Testing to Closed

#4 Updated by The Foreman Bot over 1 year ago

  • Pull request https://github.com/theforeman/foreman/pull/5791 added

#5 Updated by Ondřej Pražák over 1 year ago

  • Fixed in Releases 1.18.0 added

#6 Updated by Marek Hulán over 1 year ago

  • Related to Bug #24320: Unable to provision on Vmware, no storage data submitted added

#7 Updated by Marek Hulán over 1 year ago

  • Target version deleted (1.18.0)
  • Status changed from Closed to New
  • Fixed in Releases deleted (1.18.0)

Reopening, this does not seem to be fixed. #24320 in fact plans to revert the fix as it didn't seem to help, see https://github.com/theforeman/foreman/pull/5864#issuecomment-406555558 for more info

#8 Updated by Tomer Brisker over 1 year ago

  • Target version set to 1.18.0
  • Status changed from New to Closed
  • Fixed in Releases 1.18.0 added

Closing again. This has been shipped already in 1.18.0. Please open a new issue if needed for tracking regression caused by reverting this change.

#9 Updated by Marek Hulán over 1 year ago

  • Target version deleted (1.18.0)
  • Status changed from Closed to New
  • Fixed in Releases deleted (1.18.0)

Tomer, this is not fixed. The linked PR didn't solve the issue and it can still be reproduced on 1.18.

#10 Updated by Marek Hulán over 1 year ago

  • Status changed from New to Closed
  • Fixed in Releases 1.18.0 added

After a discussion on IRC, turns out it fixed one instance of the problem, so keeping at 1.18 as closed. Revert is already in develop and another fix should be applies, so cloning the issue for tracking.

#11 Updated by Marek Hulán over 1 year ago

  • Copied to Bug #24345: Breadcrumbs isn't refreshed properly after visiting host edit form added

Also available in: Atom PDF