[PR #75] [MERGED] fixes #74 fallback for findEntryStatus when match is missing or other… #2396

Closed
opened 2026-03-17 00:06:19 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/hoppscotch/hoppscotch/pull/75
Author: @nickpalenchar
Created: 8/28/2019
Status: Merged
Merged: 8/28/2019
Merged by: @liyasthomas

Base: masterHead: master


📝 Commits (1)

  • 1a38f51 fixes #74 fallback for findEntryStatus when match is missing or otherwise invalid

📊 Changes

2 files changed (+11 additions, -0 deletions)

View changed files

📝 assets/css/styles.scss (+4 -0)
📝 pages/index.vue (+7 -0)

📄 Description

…wise invalid

Small change with big implication!

As mentoned in #74, it would be best for both old history (which has no status number) and new history to be preserved.

findEntryStatus which in turn calls findStatusGroup, calls the Array.prototype.find which will return undefined if the callback function provided does not return true on any item. Since the callback function uses a RegEx.prototype.test on the statusCategories's .statusCodeRegex to determine a match, I added a final object with a .statusCodeRegex of /.*/ to match anything. Think of it as a default in a switch statement, since all other objects before it have to not match before hitting it.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/hoppscotch/hoppscotch/pull/75 **Author:** [@nickpalenchar](https://github.com/nickpalenchar) **Created:** 8/28/2019 **Status:** ✅ Merged **Merged:** 8/28/2019 **Merged by:** [@liyasthomas](https://github.com/liyasthomas) **Base:** `master` ← **Head:** `master` --- ### 📝 Commits (1) - [`1a38f51`](https://github.com/hoppscotch/hoppscotch/commit/1a38f519f4cfa9fc53ec9e180bf42fd2619d4c0f) fixes #74 fallback for findEntryStatus when match is missing or otherwise invalid ### 📊 Changes **2 files changed** (+11 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `assets/css/styles.scss` (+4 -0) 📝 `pages/index.vue` (+7 -0) </details> ### 📄 Description …wise invalid Small change with big implication! As mentoned in #74, it would be best for both old history (which has no status number) _and_ new history to be preserved. `findEntryStatus` which in turn calls `findStatusGroup`, calls the `Array.prototype.find` which will return undefined if the callback function provided does not return true on any item. Since the callback function uses a RegEx.prototype.test on the `statusCategories`'s `.statusCodeRegex` to determine a match, I added a final object with a `.statusCodeRegex` of `/.*/` to match anything. Think of it as a default in a switch statement, since all other objects before it have to not match before hitting it. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-03-17 00:06:19 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/hoppscotch#2396
No description provided.