Skip to content

fix(Storage): prevent saving items with empty keys - #728

Merged
Maizify merged 1 commit into
Tencent:devfrom
hobostay:fix/validate-storage-key-not-empty
Mar 16, 2026
Merged

fix(Storage): prevent saving items with empty keys#728
Maizify merged 1 commit into
Tencent:devfrom
hobostay:fix/validate-storage-key-not-empty

Conversation

@hobostay

@hobostay hobostay commented Mar 14, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add validation to prevent saving storage items with empty keys
  • Check if key is empty or contains only whitespace before saving
  • Prevents creating invalid storage entries that are difficult to manage

Bug Description

Previously, if a user cleared the key field in the storage editor and clicked save, vConsole would create a storage item with an empty key. These entries are:

  • Difficult to select and modify in the UI
  • Can cause unexpected behavior when filtering or searching
  • Generally inconsistent with proper storage key conventions

Fix

Added validation in onTapSave function that returns early if the key is empty or contains only whitespace, preventing the invalid save operation.

Test Plan

  • Open vConsole Storage tab
  • Edit an existing storage item
  • Clear the key field (or enter only spaces)
  • Click the save/done button
  • Verify that no empty-key item is created

Related Issues

Addresses potential user-reported issues with storage editor behavior.

Add validation to check if the key is empty or contains only whitespace
before saving a storage item. Previously, clearing the key field and
clicking save would create an invalid storage entry with an empty key.

Fixes potential data inconsistency where storage items could be created
with empty string keys, which are difficult to manage and can cause
unexpected behavior.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tencent-adm

tencent-adm commented Mar 14, 2026

Copy link
Copy Markdown
Member

CLA assistant check
All committers have signed the CLA.

@Maizify
Maizify merged commit 71f7998 into Tencent:dev Mar 16, 2026
2 checks passed
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.

3 participants