spamwax / alfred-pinboard-rs

Alfred Workflow for Pinboard (Rust)
Other
280 stars 13 forks source link

Error in Alfred 5 Early Access #141

Closed gingerbeardman closed 2 years ago

gingerbeardman commented 2 years ago

I'm getting the following error in Rusty Pin pinboard workflow, in Alfred 5 Early Access.

Obviously the XML is wrong, but it somehow passes as OK in Alfred 4.

[09:49:08.193] WARNING: Rusty Pin[Script Filter] XML Parse Error 'The operation couldn’t be completed. (NSXMLParserErrorDomain error 65.)'. Row 7, Col 24: 'attributes construct error' in XML:
<?xml version="1.0" encoding="UTF-8"?>
<items>
    <item arg="tax" autocomplete="tax">
        <title>tax</title>
        <subtitle>NEW TAG</subtitle>
        <icon>tag.png</icon>
        <mod key="ctrl"<mod subtitle="Mark the bookmark as TOREAD."/>
        <mod key="alt"<mod subtitle="Post the bookmark as private."/>
    </item>
    <item arg="syntax" autocomplete="syntax">
        <title>syntax</title>
        <subtitle>4</subtitle>
        <icon>tag.png</icon>
        <mod key="alt"<mod subtitle="Post the bookmark as private."/>
        <mod key="ctrl"<mod subtitle="Mark the bookmark as TOREAD."/>
    </item>
</items>
spamwax commented 2 years ago

How did you get the XML output? The output of this workflow that's sent to Alfred is in JSON format! I will get the early access next week after the holidays here and work on this. Thanks for reporting.

gingerbeardman commented 2 years ago

the XML is from the Alfred debug log panel.

https://www.alfredforum.com/topic/18508-rusty-pin-workflow-xml-parse-error-works-ok-in-alfred-4

alf

spamwax commented 2 years ago

I have a guess as why you are getting XML. The code checks for older version of Alfred to see if they support JSON vs XML It's possible since you are on a new release of Alfred, the logic for version check breaks and then code believes it's been run on an older version of Alfred, hence spits out XML. However I have to test this theory to be completely sure.

spamwax commented 2 years ago

If you can please unzip the attached file and replace the 'alfred-pinboard-rs' file in workflow's directory with it. Then in Alfred, run pconf and look for something like below in Alfred's debug window:

[2022-06-30T20:16:17Z DEBUG alfred_pinboard_rs::commands::config] Config { alfred_version: Version { major: 4, minor: 6, patch: 7 },

The version shown there should match with your current/active Alfred instance.

You can also use this simple workflow to show the current version of alfred that it stores in alfred_version env. variable

gingerbeardman commented 2 years ago

If you can please unzip the attached file

Any chance of a Universal build of this attached file?

Sadly I am on an Apple silicon ARM machine, and I have not installed the Rosetta 2 needed to run Intel binaries. The existing version of Rusty Pin features a Universal build supporting both x64 and arm64.

You can also use this simple workflow

5.0 EA5

Screen shot 2022-07-01 at 12 05 38

nickxma commented 2 years ago

Hey @spamwax did you getting it working yet? I'm having the same issue using Alfred 5

spamwax commented 2 years ago

As I guessed, the early access is reporting "non-valid" versions for Alfred hence breaking the logic of this workflow. I will try to do a more complete test of the early access before releasing a new update as I am hesitant to release a new update for small number of users while Alfred 5.0 is not officially released. However if testing proves to be longer than a day or two, I will update the workflow before Alfred 5.0 is accessible to everyone.

gingerbeardman commented 2 years ago

Thanks for the updated workflow!