Skip to content

options default to empty Objects #340

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Apr 1, 2025
Merged

Conversation

line-o
Copy link
Member

@line-o line-o commented Mar 31, 2025

This fixes some hard to understand errors when utilising some node-exist functions:

Error: XML-RPC fault: No method matching arguments: java.lang.String, java.lang.String

@line-o
Copy link
Member Author

line-o commented Mar 31, 2025

Thanks to @DrRataplan for bringing this up and suggesting the solution, too.

@DrRataplan
Copy link

Nice! This error really puzzled me!

@DrRataplan
Copy link

DrRataplan commented Apr 1, 2025

Interestingly, one test fails but only in Existdb 7:
Looks like Exist7 serialization returns xml declarations even though the xmlrpc call does not specify it? Odd. Any idea how this happens?

# read with empty options uses defaults
not ok 47 file was read
  ---
    operator: equal
    expected: |-
      '<collection>\n    <item property="value"/>\n</collection>'
    actual: |-
      '<?xml version="1.0" encoding="UTF-8"?>\n<collection>\n    <item property="value"/>\n</collection>'
    at: Test.<anonymous> (/home/runner/work/node-exist/node-exist/spec/tests/documents.js:84:10)
    stack: |-
      Error: file was read
          at Test.assert [as _assert] (/home/runner/work/node-exist/node-exist/node_modules/tape/lib/test.js:479:48)
          at Test.strictEqual (/home/runner/work/node-exist/node-exist/node_modules/tape/lib/test.js:643:7)
          at Test.<anonymous> (/home/runner/work/node-exist/node-exist/spec/tests/documents.js:84:10)
          at process.processTicksAndRejections (node:internal/process/task_queues:[95](https://github.com/eXist-db/node-exist/actions/runs/14176407503/job/39712263663?pr=340#step:6:96):5)
  ...
# read without passing options
not ok 48 file was read
  ---
    operator: equal
    expected: |-
      '<collection>\n    <item property="value"/>\n</collection>'
    actual: |-
      '<?xml version="1.0" encoding="UTF-8"?>\n<collection>\n    <item property="value"/>\n</collection>'
    at: Test.<anonymous> (/home/runner/work/node-exist/node-exist/spec/tests/documents.js:103:10)
    stack: |-
      Error: file was read
          at Test.assert [as _assert] (/home/runner/work/node-exist/node-exist/node_modules/tape/lib/test.js:479:48)
          at Test.strictEqual (/home/runner/work/node-exist/node-exist/node_modules/tape/lib/test.js:643:7)
          at Test.<anonymous> (/home/runner/work/node-exist/node-exist/spec/tests/documents.js:[103](https://github.com/eXist-db/node-exist/actions/runs/14176407503/job/39712263663?pr=340#step:6:104):10)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  ...
# serialized without XML declaration
not ok 49 expected file contents received
  ---
    operator: equal
    expected: |-
      '<collection>\n    <item property="value"/>\n</collection>'
    actual: |-
      '<?xml version="1.0" encoding="UTF-8"?>\n<collection>\n    <item property="value"/>\n</collection>'
    at: Test.<anonymous> (/home/runner/work/node-exist/node-exist/spec/tests/documents.js:121:10)
    stack: |-
      Error: expected file contents received
          at Test.assert [as _assert] (/home/runner/work/node-exist/node-exist/node_modules/tape/lib/test.js:479:48)
          at Test.strictEqual (/home/runner/work/node-exist/node-exist/node_modules/tape/lib/test.js:643:7)
          at Test.<anonymous> (/home/runner/work/node-exist/node-exist/spec/tests/documents.js:[121](https://github.com/eXist-db/node-exist/actions/runs/14176407503/job/39712263663?pr=340#step:6:122):10)
          at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
  ...

@line-o
Copy link
Member Author

line-o commented Apr 1, 2025

Looks like Exist7 serialization returns xml declarations even though the xmlrpc call does not specify it?

Yes, this change happened upstream (in exist 7) as part of an effort to store XML declarations as part of the original data. These stored declarations will now overrule the default serialisation settings.

@line-o line-o merged commit 16a71aa into eXist-db:main Apr 1, 2025
10 of 11 checks passed
@line-o line-o deleted the fix/options branch April 1, 2025 08:16
Copy link

github-actions bot commented Apr 1, 2025

🎉 This PR is included in version 5.5.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants