User being kicked out of LiteFarm App (Sprint 78)

Release 3.6.2 · LiteFarmOrg/LiteFarm

  • User perspective: When editing a revenue or expenses it appeared that the user was being kicked out of LiteFarm (in reality the browser was navigating several pages back).

  • Technical perspective: Broswer navigation takes place in several ways. Pertinent method is a custom function Jimmy built - to help persist data in multi-page forms; this works by pushing certain routes to a history stack. These are popped when you cancel or finish a form. We introduced a redirect such that when you popped these routes it took you too far.

  • Learnings:

    • Duncan found other forms (specifically in Finances) that navigation was broken too

    • Decided to do redirects instead of changing routes to keep consistent URLs; …

    • The hook that handles navigation conditions programmatically is a bad idea - evolved from 3 lines to a whole soup of edge case logic and no tests; there may be ways to simplify this or just allow the browser to handle navigation

      • Call this “route tech debt”?

    • We are doing some “very weird things with navigation” - logic was generic enough that it was very difficult to troubleshoot - might be easier to make it explicit, e.g. “If clicked from X, return to X after”.

    • Some requirements are asking for changes to the default browser behaviour - e.g. if a user clicks back after submitting a form, they shouldn’t be taken back into the flow.

  • Success: good patch and a good re-write of routes

  • On-going concerns: Lots of bugs around use of “<“ and back button; SPIKE to at least understand the shape and depth of navigation issues