You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Three high-severity regressions have been identified in the networking and persistence layers:
Networking:getEnabledRows uses indexOf to check if a row is enabled. Since indexOf returns the first occurrence of a value, duplicate parameter names (e.g., two headers named Set-Cookie) result in the second parameter always mirroring the enabled/disabled state of the first.
Utils:substituteVariables constructs a global RegExp using environment variable keys without escaping them. Keys containing metacharacters (e.g., user.id or base+url) cause a FormatException, crashing the request sequence.
Persistence:addHistoryRequest and editHistoryRequest trigger Hive writes without the await keyword. This creates a race condition where the app can be closed before the history index is updated, leading to orphaned records and data loss.
Steps to Reproduce the bug/problem
For Row Logic: Create two query parameters: key=1 (Enabled) and key=2 (Disabled). Send the request; note that key=2 is incorrectly included.
For Regex Crash: Define an environment variable with a dot, such as api.key. Use {{api.key}} in any request field and attempt to send.
For Data Loss: Send a request and force-close the app immediately. Upon restart, the request will not appear in the history list.
Expected behavior
Rows: Parameters should be filtered by their specific list index, not by value-based search.
Regex: Variable keys should be escaped using RegExp.escape() to support common naming conventions like dots and dashes.
Persistence: All database writes must be fully awaited to ensure atomic-like updates to history metadata and request bodies.
Describe the bug/problem
Three high-severity regressions have been identified in the networking and persistence layers:
getEnabledRowsusesindexOfto check if a row is enabled. SinceindexOfreturns the first occurrence of a value, duplicate parameter names (e.g., two headers namedSet-Cookie) result in the second parameter always mirroring the enabled/disabled state of the first.substituteVariablesconstructs a globalRegExpusing environment variable keys without escaping them. Keys containing metacharacters (e.g.,user.idorbase+url) cause aFormatException, crashing the request sequence.addHistoryRequestandeditHistoryRequesttrigger Hive writes without theawaitkeyword. This creates a race condition where the app can be closed before the history index is updated, leading to orphaned records and data loss.Steps to Reproduce the bug/problem
key=1(Enabled) andkey=2(Disabled). Send the request; note thatkey=2is incorrectly included.api.key. Use{{api.key}}in any request field and attempt to send.Expected behavior
RegExp.escape()to support common naming conventions like dots and dashes.Technical Details & Fix Direction
packages/better_networking/lib/utils/http_request_utils.dart.wherewith an index-basedforloop or.asMap().entries.where.lib/utils/envvar_utils.dartlib/providers/history_providers.dartawaittosetHistoryIds()andsetHistoryMeta()calls.Device Info (The device where you encountered this issue)