Skip to content

Conversation

@iandev
Copy link
Contributor

@iandev iandev commented Nov 15, 2025

Some remote files have query params, such as a pre-signed url for a cloud hosted storage bucket. This updates the extension extraction to exclude anything after the ? mark.

Pull request type

Check the type of change your PR introduces:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

NOTE: Try to limit your pull request to one type, submit multiple pull requests if needed.

What is the current behavior?

Error is thrown:
GephiLiteError: Extension graphml?sp=r&st=2025-11-15t17:54:03z&se=2025-11-15t19:09:03z..... for file cmhzgzmxe0001jg01tz2spvp4.graphml?sp=r&st=2025-11-15T17:54:03Z&se=2025-11-15T19:09:03Z...... is not recognized

What is the new behavior?

The extractGraphFromFile should exclude characters after the ? query params when it is extracting the file extension, which it then uses to construct the Graphology object.

Other information

NOTE: Any other information that is important to this PR such as screenshots of how the component looks before and after the change.

Some remote files will have query params, such as a pre-signed url to a cloud hosted storage bucket. This updates the extension extraction to exclude anything after the ? mark.
@sim51
Copy link
Collaborator

sim51 commented Nov 18, 2025

Hi,

Thanks a lot for your feedback and your PR.!

So url like "https://examples.com/graph.gexf?token=XXX" will work. But what about urls like "https://examples.com/index.php?file=graph.gexf" which is also a common use case I think no ?

Shall we keep the current test (ie pretty much an endsWith with the graph format) and if nothing is found, check that if there a ? remove it and test again ?

@paulgirard paulgirard force-pushed the dev branch 2 times, most recently from 1821124 to 8d1f50c Compare November 18, 2025 14:25
@ian-q1
Copy link

ian-q1 commented Nov 18, 2025

Hi,

Thanks a lot for your feedback and your PR.!

So url like "https://examples.com/graph.gexf?token=XXX" will work. But what about urls like "https://examples.com/index.php?file=graph.gexf" which is also a common use case I think no ?

Shall we keep the current test (ie pretty much an endsWith with the graph format) and if nothing is found, check that if there a ? remove it and test again ?

@sim51 Ah interesting case there. I suppose that would not work. Testing multiple times as you suggest would work. What about testing against the content type and the contents of the file?

case gexf -> contents contains <gexf> element
case graphml -> contents contains <graphml> element
case json -> content type = "application/json", "text/json", etc

@sim51
Copy link
Collaborator

sim51 commented Nov 18, 2025

Yes we need to find a to better determinate the type of a file.
I need to check where we use this function (I'm thinking about gist file) to see if we can always have the content of the file to do the checks you suggest.

@sim51
Copy link
Collaborator

sim51 commented Nov 21, 2025

Re,

I pushed a commit in the dev branch c6432b1

So I'm closing this PR.

Thanks for spotting this issue!

@sim51 sim51 closed this Nov 21, 2025
@iandev
Copy link
Contributor Author

iandev commented Nov 21, 2025

Sounds great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants