Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

useSubmit() should function after reconnect #4707

Merged
merged 2 commits into from Apr 13, 2023
Merged

Conversation

compulim
Copy link
Contributor

@compulim compulim commented Apr 13, 2023

Fixes #4706.

Changelog Entry

Fixed

  • Fixes #4706. Send button and ENTER key should function after reconnected, by @compulim, in PR #4707.

Description

When DLASE reconnect, ConnectionStatus.Connecting and ConnectionStatus.Online is observed again. This triggered DIRECT_LINE/RECONNECT_* actions.

After reconnected, the useConnectivityStatus() hook returns ["reconnected"], instead of ["connected"].

However, in our useSubmit() hook, we only cater "connected" but not "reconnected". That means, reconnected is more-or-less same as disconnected.

That means, when clicking on send button or ENTER key, it is not functional because useSubmit() think it is offline.

We checked other source code, and no other similar issues were discovered.

Although useSubmit() disable text box submission when offline, other hooks (e.g. useSendPostBack, useSendEvent, etc.) does not look at online status.

We should revisit the whole scenario again:

  • When offline, post activity should be disabled for all hooks, including post back and other activities, or;
  • Regardless online or offline, post activity should be allowed

Specific Changes

  • useSubmit() to consider both "connected" and "reconnected" cases as connected
  • Added tests
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim marked this pull request as ready for review April 13, 2023 06:07
@compulim compulim added the p0 Must Fix. Release-blocker label Apr 13, 2023
@compulim compulim added this to the imminent milestone Apr 13, 2023
@compulim compulim merged commit 753b8a6 into main Apr 13, 2023
8 of 10 checks passed
@compulim compulim deleted the fix-4706-reconnect branch April 13, 2023 18:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
p0 Must Fix. Release-blocker
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Send button should not be disabled after reconnected
3 participants