Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions .server-changes/irsa-xml-parser-pin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
area: webapp
type: fix
---

Magic-link login works again on self-hosted deployments that use a role for cloud credentials
27 changes: 27 additions & 0 deletions apps/webapp/test/fastXmlParserAwsEntities.test.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { readFileSync } from "node:fs";
import { dirname, join } from "node:path";
import { fileURLToPath } from "node:url";
import { describe, expect, it } from "vitest";

const rootPackageJson = JSON.parse(
readFileSync(join(dirname(fileURLToPath(import.meta.url)), "../../../package.json"), "utf8")
) as {
pnpm: { overrides: Record<string, string> };
};

describe("fast-xml-parser aws sdk compatibility", () => {
it("pins 5.x past the 5.7 window that rejects addEntity('#xD')", () => {
expect(rootPackageJson.pnpm.overrides["fast-xml-parser@>=5 <5.8.0"]).toBe("^5.8.0");
});

it("accepts the character-reference entities @aws-sdk/xml-builder registers", async () => {
const { XMLParser } = await import("fast-xml-parser");

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔍 Unnecessary dynamic import

fast-xml-parser loads unconditionally, so await import() lacks a permitted use case. Repository guidance requires a static import here.

Devin Review


Was this helpful? React with 👍 or 👎 to provide feedback.

const parser = new XMLParser({ htmlEntities: true });

expect(() => {
parser.addEntity("#xD", "\r");
parser.addEntity("#10", "\n");
parser.parse("<a>1</a>", true);
}).not.toThrow();
});
});
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
"protobufjs@>=7 <7.6.5": "^7.6.5",
"@grpc/grpc-js@>=1.12.0 <1.12.7": "1.12.7",
"fast-xml-parser@>=4 <4.5.5": "^4.5.5",
"fast-xml-parser@>=5 <5.7.0": "^5.7.0",
"fast-xml-parser@>=5 <5.8.0": "^5.8.0",
"path-to-regexp@>=0.1 <0.1.13": "^0.1.13",
"ajv@>=8 <8.18.0": "^8.18.0",
"socket.io-parser@>=4 <4.2.7": "^4.2.7",
Expand Down
18 changes: 12 additions & 6 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.