Skip to content

Improve folder name for assistant autogenerated filter names #363

@RealRaven2000

Description

@RealRaven2000

At the moment we are passing the folder path to the assistant and the last part of the path is used as a folder name. This could lead to localisation errors if the path contains special unicode characters:

    // Get folder info for last part to get localized name
    let lastFolderName = parts[parts.length - 1];
    try {
      // Construct full folder path, assuming path is relative to account root
      // This can vary; you may need to tweak this if folder paths differ.
      const folderUri = `accountid://${folder.accountId}${folder.path}`;
      const folderInfo = await messenger.folders.getFolder(folderUri);
      if (folderInfo && folderInfo.name) {
        lastFolderName = folderInfo.name;
      }
    } catch {
      // fallback to path last part
    }

it turns out that the function messenger.folders.getFolder doesn't exist, so this line always throws an exception.

We should use the "real" folder name retrieved from the API instead.to avoid ugly / unreadable filter names.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions