ssg-wsg / Sample-Codes

This repository contains sample codes (Encryption Decryption, Java, Node.js and Python) to guide and support your application development on SSG-WSG Developer Portal.
3 stars 8 forks source link

Bug: Endpoint URL to call not properly saved in Streamlit Session State #25

Open asdfghjkxd opened 1 month ago

asdfghjkxd commented 1 month ago

Describe the Bug

When navigating away from a Streamlit application via a link in the page, when navigating back to the application and attempting to call an API, the URL endpoint to use in the API calls might be reset, resulting in exceptions being thrown back to the user.

Steps

Include some steps to help us replicate the bugs!

  1. Open the Streamlit application
  2. Navigate to a page that contains a hyperlink or a form that when POST-ed, redirects you to another page
  3. Click on the hyperlink / button and navigate to the relevant URLs
  4. Navigate back to the Streamlit application by using the back navigation arrow
  5. Attempt to call an API
  6. An exception should be thrown

Expected Behavior

No exceptions should be thrown.

Actual Behavior

Exceptions related to a missing variable are thrown.

Possible Solution

Do a check that the URL is present before calling the APIs. If the URL is missing, warn the users and have users navigate back to the Home Page to reset the URL.

Logs

N/A

Environment

Fill in some details about your environment to let us better diagnose your problems!

Additional Context

N/A

asdfghjkxd commented 1 month ago

Fixed in #26