apache / apache/shenyu

[BUG] <title> In rulesList, The un-matching request will cause normal requests to fail

Open
#5,588 6 comments 0 reactions 0 assignees View on GitHub
type: bug
Dominant language
Java
Stars
8.8k
Forks
3.1k
Avg merge
7d 1h
Merged PRs (30d)
85

Description

### Is there an existing issue for this?

- [X] I have searched the existing issues

### Current Behavior

this is my rule setting in modifyResponse plugin
image
this is matching case
image
this is un-matching case without add body info
image
but after un-matching case, the matching case become un-match
image
this operates in orders

### Expected Behavior

Whenever the request happens, the matching scene should be matched

### Steps To Reproduce

1. in shenyu-master branch
2. set matching rules
3. happen one un-matching case
4. matching case will dismatch

### Environment

```markdown
ShenYu version(s):
master
```

### Debug logs

this is the logs under matching case but un-matching and without modifyResponse rule success match info.
image

### Anything else?

i have debug in this case, find some questions in this line,
why caches an empty ruleData when not match rules.
image
`cacheRuleData(path, emptyRuleData);`
when i delete this line ,this bug will be fixed. but i am not sure this operate is correct.
Can u introduce the original intention of this line which cache empty ruleData?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start at cacheRuleData(path, emptyRuleData) in the modifyResponse plugin and reproduce the matching, un-matching, then matching request sequence described in the issue. Determine the intended handling of an empty cached rule and verify that subsequent matching requests still match, adding or updating coverage if the relevant test location can be identified.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, backend
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.