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

Influx doesn't work at all #88

Open
pivic opened this issue Nov 18, 2024 · 13 comments
Open

Influx doesn't work at all #88

pivic opened this issue Nov 18, 2024 · 13 comments
Labels
bug Something isn't working

Comments

@pivic
Copy link

pivic commented Nov 18, 2024

Describe the bug
Influx no longer works for me. I'm currently running Obsidian 1.7.6 on a couple of different desktop operating systems and on Android 14 and 15.

To Reproduce
Steps to reproduce the behavior:

  1. Use an existing or new Obsidian vault.
  2. Install Influx.
  3. Activate Influx.
  4. Make sure the 'Live update' functionality is enabled.

Expected behavior
Influx information should appear at the bottom of notes that are mentioned in other notes.

Screenshots
Sorry, I have none. Just imagine a note with no Influx information appearing.

Desktop (please complete the following information):

  • OS: Windows 11 (latest version), macOS (latest version of Sequoia)
  • Version [e.g. 22]: please see above

Additional context
I can't remember when Influx stopped working for me, but it's been around half a year since it last worked, in all probability. I'm an Obsidian Catalyst supporter, and I've been using 'early access versions' for years.

@pivic pivic added the bug Something isn't working label Nov 18, 2024
@Rushmik
Copy link

Rushmik commented Nov 21, 2024

I have the same issue. I much prefer Influx over the core Backlinks plugin, and would love to see this updated. I've yet to find any other alternative apart from these two.

@milkyskies
Copy link

@Rushmik You should try the Better Search Views plugin. They have a feature similar to influx.

@pivic
Copy link
Author

pivic commented Nov 25, 2024

Thanks a lot @milkyskies. I think using that plugin and their 'version' of backlinks could work for me. I'll need to try it out.

Another good thing about that plugin: I didn't know they'd added things like embedded queries. Could be useful.

@bvsbuild
Copy link

bvsbuild commented Dec 3, 2024

It just broke for me on the update to 1.7.7. I agree @Rushmik, I also much prefer Influx for it's simplicity, ability to render at the top of the page, and the general clarity of styling. My whole system is built around bulleted lists that flow up into aggregate notes when tagged with a link. It's a bummer to switch away from such a functional and simple solution like Influx.

@bvsbuild
Copy link

bvsbuild commented Dec 3, 2024

Oh, another critical item this plugin has that the other doesn't is ability to save sorting order. Obisidian and Better Search Views don't offer a way to save sort order for page backlinks. I want newest first, and unfortunately default is opposite.

@ashcreighton
Copy link

ashcreighton commented Dec 9, 2024

@bvsbuild same for me. I'll never understand why this insanely basic functionality is missing year after year. @milkyskies @pivic Better Search Views improves Obsidian backlink presentation but does not offer any way to save backlink sorting order (Influx was the only plugin to ever achieve this).

@bvsbuild
Copy link

I've been digging in the code (with no idea what I'm doing). If anyone (or @jensmtg) has a clue where to even start looking, please share and I'll continue troubleshooting to try to figure out some kind of patch. Getting desperate to have this functionality back. One thing I didn't realize I loved and needed was the way it would even surface backlinks into notes on canvas. I know there are a lot of people looking for this functionality (https://forum.obsidian.md/t/canvas-cards-and-notes-in-links-backlinks-and-outgoing-arrows-in-graph-view/49697, https://forum.obsidian.md/t/showing-linked-mentions-backlinks-within-a-note-on-canvas/53065), and Influx pulled it off!

@bvsbuild
Copy link

bvsbuild commented Jan 14, 2025

I think I got to the bottom of it with some heavy use of chatGPT. Seems a recent obsidian core update changed how backlink data is stored - now as a map and not an array. It needed to be in an array. To hotfix,

  1. go to /.obsidian/plugins/influx/main.js,
  2. search for the following function:
makeInfluxList() {
    return __async(this, null, function* () {
      this.backlinks = this.api.getBacklinks(this.file);
      const inlinkingFilesNew = [];
      const backlinksAsFiles = Object.keys(this.backlinks.data).filter((pathAsKey) => pathAsKey !== this.file.path && this.api.isIncludableSource(pathAsKey)).map((pathAsKey) => this.api.getFileByPath(pathAsKey));
      yield Promise.all(backlinksAsFiles.map((file) => __async(this, null, function* () {
        const inlinkingFile = new InlinkingFile(file, this.api);
        yield inlinkingFile.makeSummary(this);
        inlinkingFilesNew.push(inlinkingFile);
      })));
      this.inlinkingFiles = inlinkingFilesNew;
    });
  1. replace it with this:
makeInfluxList() {

  return __async(this, null, function* () {
    // 1. Get the Map from getBacklinks
    this.backlinks = this.api.getBacklinks(this.file);
    
    // 2. Create an array of valid paths
    const validPaths = [];
    for (const [pathAsKey, backlinkArray] of this.backlinks.data) {
      // Exclude current note & check if includable
      if (pathAsKey !== this.file.path && this.api.isIncludableSource(pathAsKey)) {
        validPaths.push(pathAsKey);
      }
    }

    // 3. Convert those paths to TFile objects
    const backlinksAsFiles = validPaths.map((pathAsKey) => this.api.getFileByPath(pathAsKey));

    // 4. Create InlinkingFile objects & do the summary calls
    const inlinkingFilesNew = [];
    yield Promise.all(backlinksAsFiles.map((file) => __async(this, null, function* () {
      const inlinkingFile = new InlinkingFile(file, this.api);
      yield inlinkingFile.makeSummary(this);
      inlinkingFilesNew.push(inlinkingFile);
    })));

    // 5. Store them on this.inlinkingFiles
    this.inlinkingFiles = inlinkingFilesNew;
  });
}

Obviously a bit hackish to edit the compiled main.js, but it works for now! Maybe the developer can merge the fix in one day, but if not, hopefully this helps someone else who loves the functionality of this great plugin.

@ashcreighton
Copy link

ashcreighton commented Jan 14, 2025

@bvsbuild great scott, you really did it!!! amazing work!!!!! 👏

One tiny weird thing—when in edit mode, each backlink record starts with this code in bold: ir="auto">_

But that code disappears when I toggle to preview mode and everything looks perfect.

Either way, this is incredible—thank you for figuring it out and sharing i!

@bvsbuild
Copy link

bvsbuild commented Jan 14, 2025

Glad it helped someone else @ashcreighton! On the ir="auto" thing, I think toggling off the "show headers" option in the Influx settings is what helped me. You lose a little context, but for me it wasn't too valuable.

@Rushmik
Copy link

Rushmik commented Jan 16, 2025

@bvsbuild thanks for getting this working again! My Obsidian experience is much improved thanks to you.

@ashcreighton this is a band-aid fix, but you can remove the ir="auto">_ prepend by replacing the line–
dangerouslySetInnerHTML: { __html: extended.titleInnerHTML }
–with:
dangerouslySetInnerHTML: { __html: extended.titleInnerHTML.replace(/ir="auto">_/g, '') }

Hope this helps!

@pivic
Copy link
Author

pivic commented Jan 16, 2025

@bvsbuild thanks a lot for your workaround! Lovely...

@ashcreighton
Copy link

I appreciate that @Rushmik, but that edit actually disabled Influx altogether for me. Changing it back made it work again, so I'll live with it :)

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

5 participants