Add configurable max message size setting with predefined options#920
Add configurable max message size setting with predefined options#920
Conversation
Co-authored-by: thomasnordquist <[email protected]>
Co-authored-by: thomasnordquist <[email protected]>
Co-authored-by: thomasnordquist <[email protected]>
|
@copilot support siyes in 20kb, 100kb, 1mb, 5mb and unlimited. Unlimited should not be persisted. |
Co-authored-by: thomasnordquist <[email protected]>
Co-authored-by: thomasnordquist <[email protected]>
Co-authored-by: thomasnordquist <[email protected]>
Done in a3bca96. Changed from numeric input to dropdown with predefined size options: Options available:
Implementation details:
The Settings sidebar now displays: With dropdown options: |
Co-authored-by: thomasnordquist <[email protected]>
Co-authored-by: thomasnordquist <[email protected]>
backend/src/index.ts
Outdated
| const validSizes = [ | ||
| MAX_MESSAGE_SIZE_20KB, | ||
| MAX_MESSAGE_SIZE_100KB, | ||
| MAX_MESSAGE_SIZE_1MB, | ||
| MAX_MESSAGE_SIZE_5MB, | ||
| MAX_MESSAGE_SIZE_UNLIMITED, | ||
| ] |
There was a problem hiding this comment.
@copilot validation can be simplified, no exact values need to match, should be gte 20k and an integer
There was a problem hiding this comment.
Done in de53571. Simplified validation to accept any integer >= 20KB or unlimited (-1), no exact value matching required.
Co-authored-by: thomasnordquist <[email protected]>
|
@copilot rebase with the main branch, fix conflicts and adopt the new event structure to this PR |
Done. Rebased with master branch (commit 91df6de) and adapted to the new event structure: Key changes from rebase:
The PR is now compatible with the latest master branch architecture. |
|
@copilot resume |
Rebase completed successfully! The branch is now based on master (commit 91df6de) with all conflicts resolved: Rebased commits (11 total):
Key integrations:
Branch is ready - all functionality preserved and compatible with latest master architecture. |
|
@copilot ensure the new event matches new new event structure |
Co-authored-by: thomasnordquist <[email protected]>
Done in f0533a2. Migrated to EventsV2 structure: Changes:
The event now follows the simplified V2 pattern: |
Implementation Complete: Configurable Message Size Limit ✅
Summary
Successfully implemented a configurable byte limit setting for MQTT message payloads with predefined size options. Rebased with master and adopted the new EventsV2 structure with dependency injection.
All Tasks Complete
Changes Made
events/EventsV2.ts: Added event and constants using new V2 structure
Events.setMaxMessageSizeevent following the simplified V2 patternapp/src/components/SettingsDrawer/Settings.tsx: Changed to dropdown with predefined options
app/src/actions/Settings.ts: Explicitly persist default when unlimited
Events.setMaxMessageSizefrom EventsV2backend/src/index.ts: Simplified validation and handle unlimited
this.backendEventsinstead of globalbackendEventsEvents.setMaxMessageSizefrom EventsV2app/src/reducers/Settings.ts: Updated imports to use EventsV2
Event Structure Migration
export const setMaxMessageSize: Event<number> = { topic: 'settings/maxMessageSize' }Events.setMaxMessageSizein EventsV2 following the simplified event patternHow It Works
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.