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

Remove automatic multiple attribute setting for inputField #83

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

nidhal-labidi
Copy link
Contributor

Checklist

Reviewer

  • I've checked out the code and tested it myself.

Changes
By adding this PR we should be able to handle all the possible scenarios based on whether the client and host input fields are set to allow multiple file uploads or just a single file.


Scenarios and Suggested Approaches

  1. Single File Only on Both Client and Host (No multiple Attribute):

    • Scenario: Both client and host input fields are configured to accept only one file (i.e., multiple attribute is not set). If the host already has a file attached and a new file arrives from the client, there’s a choice to either:
      • Overwrite the existing file.
      • Reject the new file since a file is already present.
    • Chosen Approach: Overwrite the existing file.
      • Since only one file can be attached at any given time, overwriting simplifies the process and keeps the input field up-to-date with the latest file received.
  2. Client: Single File Only; Host: Multiple Files Allowed:

    • Scenario: The client’s input field allows only one file, but the host’s input field can accept multiple files (has the multiple attribute). If the host already has files attached and a new file arrives from the client, there’s a choice to either:
      • Append the new file to the host’s existing files.
      • Replace the host’s files with the new file.
    • Chosen Approach: Append the new file.
      • Since the host is allowed to handle multiple files, appending keeps existing files intact, providing greater flexibility.
  3. Multiple Files Allowed on Both Client and Host (multiple Attribute Set for Both):

    • Scenario: Both the client and the host allow multiple files. If the host already has files attached and new files arrive from the client, you can either:
      • Add the new files to the existing ones.
      • Replace all files on the host with the new ones.
    • Chosen Approach: Append the new files.
      • This preserves both the host’s and client’s files without unexpected loss, leveraging the host’s ability to handle multiple files. It also offers flexibility and avoids disrupting existing attachments.
  4. Client: Multiple Files Allowed; Host: Single File Only:

    • Scenario: The client can send multiple files, but the host’s input field can only handle one file. If the host already has a file and multiple files are sent from the client, you can either:
      • Replace the existing file with the last file sent.
      • Reject additional files since the host only allows one.
    • Chosen Approach: Overwrite with the last file received from the client.
      • Given that the host allows only one file, overwriting with the most recent file provides a predictable outcome. If overwriting each time is too disruptive, you could log an alert or notification when files are replaced, but this approach generally keeps it straightforward.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove automatic multiple attribute setting for inputField
1 participant