Repository: next.js
Issue: Revalidation of multiple tags at once fails
Labels: bug,Pages Router

### Verify canary release

- [X] I verified that the issue exists in the latest Next.js canary release

### Provide environment information

```bash
Operating System:
      Platform: linux
      Arch: x64
      Version: #83-Ubuntu SMP Thu Jun 15 19:16:32 UTC 2023
    Binaries:
      Node: 18.17.0
      npm: 9.6.7
      Yarn: N/A
      pnpm: N/A
    Relevant Packages:
      next: 13.4.12
      eslint-config-next: 13.4.9
      react: 18.2.0
      react-dom: 18.2.0
      typescript: 5.0.4
    Next.js Config:
      output: N/A
```


### Which area(s) of Next.js are affected? (leave empty if unsure)

Data fetching (gS(S)P, getInitialProps)

### Link to the code that reproduces this issue or a replay of the bug

https://codesandbox.io/p/sandbox/dazzling-wozniak-l3f9sn?file=%2Fapp%2Fapi%2Frevalidate%2Froute.ts%3A4%2C33

### To Reproduce

### Explanation:
Doing either `revalidateTag` or `revalidatePath` multiple times during a request.
I recreated this in the codesandbox [here](https://codesandbox.io/p/sandbox/dazzling-wozniak-l3f9sn?file=%2Fapp%2Fapi%2Frevalidate%2Froute.ts%3A4%2C33).

To test this, I have an API returning a timestamp to know if the cache has revalidated `app/api/tags/fake-data`.
I then have an API route calling that API twice with different params to have two separate tags, first for `tag1`, second for `tag2`.  (`app/api/tags`)
I then have an API to revalidate both of those tags under `app/api/revalidate`.

### Steps:
1. Navigate to `/api/tags` and it should output two timestamps. These will now be cached under tags `tag1` and `tag2`
2. In a second tab, open `/api/revalidate`, this will revalidate both of those tags in the single call.
3. Go and refresh the first tab and you will see only one of them has changed. If you go to the file `app/api/revalidate`, you can comment out either one and by themselves they work normally, it's only 2+ calls to `revalidateTag` that causes revalidation to not occur.

### Describe the Bug

When revalidating specific tags or paths inside of a request like so.
```
import { revalidateTag } from "next/cache";
import { NextResponse } from "next/server";

type revalidateProps = {
    routes : string[],
}

export async function POST(req) {
    const body = await req.json();
    try {
        const { routes } = body as revalidateProps;
        routes.forEach(function (route) {
            revalidateTag(route);
        });
        return NextResponse.json({ revalidated: true, now: Date.now() }, {status: 200});
    } catch (err) {
        return NextResponse.json({message: `Error revalidating error: ${err}`}, {status: 500});
    }
}
```
This causes either none of the tags to be revalidated or only part of them.
Currently to get around this we are doing an API call per tag.

When revalidating only one tag in each request the revalidation works perfectly, its only when trying to call the `revalidateTag` function more than one time (for example in a for loop) that this bug occurs.

### Expected Behavior

All tags that are revalidated using `revalidateTag` during a request should be revalidated. 
This could perhaps even be solved by adding a `revalidateTags` to avoid individual calls.

### Which browser are you using? (if relevant)

_No response_

### How are you deploying your application? (if relevant)

Docker (node image)