logseq-jira icon indicating copy to clipboard operation
logseq-jira copied to clipboard

Square brackets in summary cause errors

Open jwhonce opened this issue 1 year ago • 3 comments

Describe the bug If the Jira summary contains square brackets, then updating will cause the URL in the block to become corrupted. Enabling the experimental auto refresh, will eventually rewrite the URLs until errors are thrown on startup.

To Reproduce Steps to reproduce the behavior:

  1. Create a block with with a Jira issue key where the summary includes a square bracket
  2. Invoke /Jira: Update Issue
  3. Note block and URL are as expected
  4. Now invoke /Jira: Update Issue a second time
  5. Note how URL has been rewritten, each update will further corrupt the URL

Expected behavior /Jira: Update Issue should rewrite the block information updating information that has changed.

Screenshots From journal file:

- initial invocation of Update Issue
- [⚪️ To Do - RUN-1914|[SPIKE] Investigate other CI-solutions](https://issues.redhat.com/browse/RUN-1914)
  assignee:: Lokesh Mandvekar
  priority:: Major
  status:: To Do

- second invocation of Update Issue
- [⚪️ To Do - [⚪️ To Do - RUN-1914|[SPIKE] Investigate other CI-solutions](https://issues.redhat.com/browse/RUN-1914)|[SPIKE] Investigate other CI-solutions](https://issues.redhat.com/browse/RUN-1914)
  assignee:: Lokesh Mandvekar
  priority:: Major
  status:: To Do

Desktop (please complete the following information):

  • OS: Fedora 40
  • Browser Firefox
  • Version

Smartphone (please complete the following information):

  • Device: [e.g. iPhone6]
  • OS: [e.g. iOS8.1]
  • Browser [e.g. stock browser, safari]
  • Version [e.g. 22] logseq 0.10.9, Logseq Jira Sync 0.6.0

Additional context

{
  "primarySettings": null,
  "jiraBaseURL": "issues.redhat.com",
  "jiraUsername": "[email protected]",
  "jiraAPIToken": "...",
  "jiraAuthType": "PAT",
  "jiraAPIVersion": "2",
  "enableBlockPropertiesHeading": null,
  "updateInlineText": true,
  "autoRefresh": "No",
  "enableOrgMode": false,
  "addToBlockProperties": true,
  "showSummary": false,
  "showAssignee": true,
  "showPriority": true,
  "showFixVersion": false,
  "showStatus": true,
  "showReporter": false,
  "showResolution": true,
  "secondOrgHeading": null,
  "enableSecond": false,
  "jiraBaseURL2": "orgname2.atlassian.net",
  "jiraUsername2": "",
  "jiraAPIToken2": "",
  "jiraAuthType2": "Basic Auth",
  "jiraAPIVersion2": "3",
  "queriesJQL": null,
  "jqlQueryTitle": "",
  "jqlQuery": "assignee= currentUser() AND statusCategory != Done and Updated >= -30d",
  "disabled": false
}

jwhonce avatar Jun 28 '24 18:06 jwhonce

Hey, great catch! I was wondering why it was happening in some cases but not others, until you pointed out the nested brackets. Thanks, it's fixed in the new release. Let me know if it doesn't work, and we can reopen the issue.

Here you go!

https://github.com/adyscorpius/logseq-jira/releases/tag/v0.6.1

adyscorpius avatar Jun 28 '24 19:06 adyscorpius

@adyscorpius

I downloaded 0.6.1.zip and installed it as an unpackaged plugin. The initial lookup works, the update lookup now fails with:

image

jwhonce avatar Jul 01 '24 16:07 jwhonce

Hi @jwhonce,

Do you have other requests working fine and only this one giving an error? Can you share the headers being sent by a successful and failing request? (Please make sure you remove any API keys and randomize the endpoint.)

adyscorpius avatar Jul 10 '24 01:07 adyscorpius