Skip to content

"user.yaml" ignores the last user if file does not end with a newline #59

@Aravinda-HWK

Description

@Aravinda-HWK

Description:

Currently, the system that reads user.yaml does not correctly parse the last user entry if the cursor or file does not end with a newline. This leads to the last user in the configuration being ignored.

Example user.yaml:

users:
  - username: user1
  - username: user2
  - username: user3

If the file does not have a newline after user3, the last user is not added by the system.

Expected behavior:

  • All users listed in user.yaml should be loaded, regardless of whether the file ends with a newline or not.

Steps to reproduce:

  1. Update the user.yaml file as shown above, without a newline after the last user.
  2. Run the application(services/add_user.sh) or script that loads users from user.yaml.
  3. Observe that the last user (user3) is not loaded.

Proposed solution:

  • Ensure the YAML parser reads the last element even if the file does not end with a newline.
  • Alternatively, validate the file during startup and automatically append a newline if missing.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions