share-note: Unable to share note IOS 18.3.1

Device:

Iphone 16 Pro

Software Version:

IOS 18.3.1

Description of issue:

When attempting to share note on the web or copy shared link, an error stating “There was an error uploading the note, please try again” is returned. The error occurs even in a fresh local vault with only share note installed, along with persisting after reinstalling the app. The error does not appear when setting Obsidian’s app.emulateMobile() feature to true via the console. I am able to successfully share my notes on the desktop version of Obsidian whether emulating mobile or not. It seems to be an error specific to an IOS device.

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (8 by maintainers)

Commits related to this issue

Most upvoted comments

The published v1.2.0 works for me on iOS 18.3.1. Thanks @PuppetAJ and @alangrainger for solving this so quickly! 🙏

The server and plugin have both been updated, and this is live in 1.2.0.

Both old and new versions can successfully create notes on Linux/Android, and hopefully 1.2.0 will work on iOS 18 😃

Yep! Can confirm that the issue is fixed on my device, and I’m able to share my notes now thank you!

Awesome, I was able to pull the #158-iv branch and test it on my mobile device and successfully create a link to a shared note-

All that’s left are the changes you mentioned to be able to decrypt it on the server and (hopefully) the issue should be resolved

@PuppetAJ that’s phenomenal, thank you for solving that!

In regards to the IV, it’s just an integer index counter, so we can add a new function to create an IV of the correct length:

/**
 * Take an integer index and return the corresponding IV
 */
function indexToIv (int: number) {
  const array = new Uint8Array(12)
  for (let i = 0; i < array.length; i++) {
    array[i] = int % 256
    int = Math.floor(int / 256)
  }
  return array
}

and

    const bufCiphertext: ArrayBuffer = await window.crypto.subtle.encrypt(
      {
        name: 'AES-GCM',
        iv: indexToIv(index)
      },

From the link you posted “Note that the IV does not have to be secret, just unique” - so an incrementing index is fine.

However, I’ll have to do a bit of fiddling on the server to handle both the old and the new style (depending what version of the plugin someone is using), and output the correct decryption code.

I’ll have that up hopefully tomorrow.

Good news and bad news:

I discovered that the plugin I’m using to view a developer console on mobile vConsole has some flaws that are making all CryptoKey objects display as having a type of PARSE_ERROR. I discovered this when checking between my desktop version’s console and the displayed vConsole tab. They display properly on the normal console accessed via ctrl + shift + i but show a PARSE_ERROR on vConsole’s logs.

What this means is that the issue isn’t necessarily traced down to the functions I identified in my previous messages. However, there are ways around these display errors by explicitly checking the CryptoKey.type property and logging it to console. Using this I’m going to trace back my steps to see where the issue truly is.

I updated to version 1.1.3 and the error is still present on my test vault. The error I’m getting is still a DOMException.