Skip to content
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

[BUG] Wrong reference report when duplicated URL #274

Open
aeqz opened this issue Jan 30, 2023 · 1 comment
Open

[BUG] Wrong reference report when duplicated URL #274

aeqz opened this issue Jan 30, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@aeqz
Copy link
Contributor

aeqz commented Jan 30, 2023

Description

When the same URL is present in different references and it produces a verification error, all of its occurrences are reported with the same reference.

To Reproduce

Steps to reproduce the behavior:

  1. Create a file named a.md with the following contents:
[Bad url](https://bad-test-url.com)

[The same bad url](https://bad-test-url.com)
  1. Initialize a repository with this file and run:
xrefcheck

The output is as follows:

=== Invalid references found ===                                                                                                                    

  ➥  In file a.md
     bad reference (external) at src:1:1-35:
       - text: "Bad url"
       - link: https://bad-test-url.com

     ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "bad-test-url.com", service name: Just "443"): does not exist (nodename nor servname provided, or not known)

  ➥  In file a.md
     bad reference (external) at src:1:1-35:
       - text: "Bad url"
       - link: https://bad-test-url.com

     ConnectionFailure Network.Socket.getAddrInfo (called with preferred socket type/protocol: AddrInfo {addrFlags = [AI_ADDRCONFIG], addrFamily = AF_UNSPEC, addrSocketType = Stream, addrProtocol = 0, addrAddress = 0.0.0.0:0, addrCanonName = Nothing}, host name: Just "bad-test-url.com", service name: Just "443"): does not exist (nodename nor servname provided, or not known)

Invalid references dumped, 2 in total.

Expected behavior

One of the references should correspond to "Bad url" and the other one to "The same bad url", but both of the reported errors correspond just to one of them.

Environment

  • OS: macOS Ventura 13.1
  • branch: master (4a33023)

Additional context

I have not checked it, but I think that this may be a consequence of the external reference verification cache, which is probably caching both the result and the reference.

@aeqz aeqz added the bug Something isn't working label Jan 30, 2023
@Martoon-00
Copy link
Member

Oh, very good spot, wonder how we missed that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants