Jump to content

Some installations rejecting XML others accept


Recommended Posts

Bit of a funny one this.

 

Basically, I'm posting here because I've been trying to debug an error that some users are having with a workflow I made but I've reached a point where I can't go make any further progress without assistance from "on high".

 

I verified both users were using the latest version of Alfred, and had them run the workflow's script in the Terminal (no errors) and send me the generated XML. I can feed the XML back into my Alfred and the results show up just fine. There are also no non-ASCII characters in the XML which might have caused text encoding issues.

 

I have been entirely unable to replicate the problem.

 

I'd be happy to provide the XML via a non-public channel.

 

I realise that filing this as an Alfred bug is somewhat tenuous, but as noted, my Alfred install accepts the same output, so I've exhausted the possibilities open to me, and Andrew is the only person who could possibly provide more insight, as he's the only one who can see what Alfred's doing with workflow output it doesn't like.

 

 

Link to comment

Bit of a funny one this.

 

Basically, I'm posting here because I've been trying to debug an error that some users are having with a workflow I made but I've reached a point where I can't go make any further progress without assistance from "on high".

 

I verified both users were using the latest version of Alfred, and had them run the workflow's script in the Terminal (no errors) and send me the generated XML. I can feed the XML back into my Alfred and the results show up just fine. There are also no non-ASCII characters in the XML which might have caused text encoding issues.

 

I have been entirely unable to replicate the problem.

 

I'd be happy to provide the XML via a non-public channel.

 

I realise that filing this as an Alfred bug is somewhat tenuous, but as noted, my Alfred install accepts the same output, so I've exhausted the possibilities open to me, and Andrew is the only person who could possibly provide more insight, as he's the only one who can see what Alfred's doing with workflow output it doesn't like.

 

The most likely thing will be some of the text you are inserting into the XML isn't correctly encoded (e.g. folder names with UTF-8 characters which haven't been encoded for the XML). Have you tried pre-encoding the strings before putting them into the XML?

 

As this is specific to your workflow and a subset of users, I currently don't think it's going to be a bug in Alfred (which uses Apple's own XML parser), so I'm going to move this to the Workflow Help sub-forum to get more eyes on your issue.

 

It's also worth noting that Alfred 2.2, which I am currently working on, will help debug this issue as you can see XML errors in the workflow debugger.

 

(I'll keep an eye on this thread)

 

Cheers,

Andrew

Link to comment

Thanks for the speedy response Andrew.

Encoding issues was my first thought, too, but I'm confident I've excluded that possibility.

As noted, the XML consists only of ASCII characters. I'm 99.9% certain it isn't an encoding problem on my end. I had the users capture the output in files via shell redirection, zip 'em (to avoid the content getting encoded/decoded) and send them to me. I wrote a workflow to cat the file contents to my Alfred, and it works perfectly.

I work with a lot of German text and files, so the workflow has been thoroughly tested with non-ASCII input and output. All input is properly decoded to Unicode and NFD-normalised, the XML output is UTF-8 encoded before it's sent to Alfred (and it's all encoded at once, to ensure no mixed encodings). Please feel free to check the code.

I still suspect it does have something to do with text encoding, but between the workflow and Alfred on systems with some non-standard configuration. Unfortunately, with zero feedback from Alfred, I felt my only remaining option was to ask you (I want my workflows to work for everyone), as you're the only person with access to concrete information on why workflows fail in Alfred, but work on the CLI.

Consequently, I'm extremely pleased to hear that a debugger is coming. Will it also show error messages from internal workflow errors (i.e. the stderr output)? I dearly hope so. Scriptable apps (such as Automator and Alfred) that don't provide that information are difficult to develop for.

Edited by deanishe
Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...