Skip to content

Basic navigation back issue (GET-POST-REDIRECT_BACK results in extra GET call) #213

Description

@ajaishankar

Hi

@joemasilotti

I am on Hotwire Native 1.2.2 and have a non rails server (Hono)

Trying to do the following - which works on web.

The idea is to collect data in separate screens showing correct navigation presentations.

  • From /page1, advance to /page2 (push screen on stack - works)
  • In /page2 show a form to collect data
  • On form POST store data in a cookie and 303 redirect back to previous page (/page1)
  • Navigate back to /page1 popping screen off stack (works as expected as it is same url)
  • In GET /page1
    • Render collected data
    • Delete data cookie

But when navigating back, hotwire-ios makes an extra call to /page1 and UI does not show collected data as it was deleted in previous call

--> POST /page2 303
--> GET  /page1 200 (data cookie gets deleted here)
--> GET  /page1 200 (EXTRA CALL that returns no data as cookie was deleted)

This might be similar to #178

Also struggled with these less documented functionality:

  • Redirect to /recede_historical_location (hoping to avoid extra call)
    • Did not work as Hotwire tried to fetch this location instead
  • "query_string_presentation": "refresh" for page1
    • Was trying things without POST but page1 kept showing stale content

I am at a large company and we are trying to move our native app to a hybrid one using Hotwire native.

Thanks

Ajai

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions