aslushnikov / latex-online

Online latex compiler. You give it a link, it gives you PDF
http://latexonline.cc
MIT License
497 stars 89 forks source link

Possible caching problem: multiple PDFs from the same Git repo #4

Closed mgeier closed 10 years ago

mgeier commented 10 years ago

First of all: thanks for this great service!

I have several subdirectories in a Git repository where I want to build PDFs from.

Sometimes (not always!) I get the PDF from a different subdirectory than I asked for.

I guess this is a cache problem where the cache doesn't distinguish between different subdirectories within the same Git repository.

Here are 3 links to try it:

http://latex.aslushnikov.com/compile?git=https://github.com/mgeier/literature-review&target=binaural_audio/binaural_audio.tex&download=mgeier_binaural_audio.pdf http://latex.aslushnikov.com/compile?git=https://github.com/mgeier/literature-review&target=panning/panning.tex&download=mgeier_panning.pdf http://latex.aslushnikov.com/compile?git=https://github.com/mgeier/literature-review&target=wfs/wfs.tex&download=mgeier_wfs.pdf

mgeier commented 10 years ago

I just had a look at the code, this may be a fix:

In process.js in the processGit function near line 206 you could try to replace

self.hashAndGet("git", self.options.entity, hashAndGetCallback);

with

self.hashAndGet("git", self.options.entity + "/" + self.options.target, hashAndGetCallback);
aslushnikov commented 10 years ago

Both issue and it's proposed fix seem to be reasonable, though I haven't looked deeply into the code yet and will double-check a bit later. Would you mind sending a pull request?

P. S. Thank you for the bug report!

mgeier commented 10 years ago

Sure, no problem, I created a pull request.

Keep in mind, however, that my changes are untested!

aslushnikov commented 10 years ago

Reopening as the fix was reverted.

mgeier commented 10 years ago

Thanks for fixing it, now it works perfectly!

Sorry for the faulty pull request!