Issue threads on created folder (label) - Gmail

Hey, guys.
I am facing a problem with the Gmail folder (label). I did this in “Nylas Playground”, so I think it will be easy to reproduce.

Creating a folder

Checking the folder in Gmail and adding a thread in it

Checking folder in Nylas Playground

here you can see the counter containing a thread

The problem

Hi @VictorMonteiro7 - just clarifying the images/steps, can you confirm the below flow:

  1. :white_check_mark: Label / Folder Created
  2. :white_check_mark: Message added to Folder
  3. :negative_squared_cross_mark: Retrieving all threads by Folder ID returns null or empty even though messages exist within the folder/label in Gmail UI
1 Like

Hey @ram, it is correct.

1 Like

Let me try to reproduce and I will circle back :+1:

Ok, I’ll be waiting.

Okay, reproduced similar - let me confirm what’s going on and circle back.

So this statement needs clarification: Returns threads with messages that belong to the specified folder. This parameter supports filtering by folder ID

Thanks @ram. I’ll be waiting.

1 Like

@VictorMonteiro7 “Label_7” is an internal Id, that’s why it’s not working, you need to use the folder name which is “Test Folder Nylas Forum” :blush: I just test it on Ruby :wink:

query_params = {
    in: "Test Folder Nylas Forum",
    limit: 1
}

Hey @Blag, so I think it should change in the docs, because it says: “Returns threads with messages that belong to the specified folder. This parameter supports filtering by folder ID.”.

Anyway, I test locally and works with name (as you said), but It works only with gmail, because the id and name of gmail folders are equals, while others providers the id is a unique generated string.

@VictorMonteiro7 You’re right, the documentation should be updated.

In Gmail the id and the name are not equal, when I created the same folder that you did, it is:

Label_20 | Test Folder Nylas Forum

But yes, I think using the name only works for Gmail, that should be reflected on the documentation as well.

@Blag You’re right, but I expressed myself badly.
When I said “because the id and name of gmail folders are equals”, I was referring to the others folders. Example: in Gmail, inbox folder has id and name as INBOX, but in outlook has id as a unique generated string and the name as inbox.
So, if I change all my methods to fetch the threads by the name, I will have some problems.

@VictorMonteiro7 I see what you mean :slight_smile: Although how different provides handle their Id’s go beyond our scope :frowning: You might need to determine which provider you’re working with using Detect Provider Nylas API v3 Administration docs | Nylas Docs

@Blag I did it, hehe. But, I made some tests and the right way is to fetch the threads using the id. Fetching with name most of the time returns an empty array.

Hi, just want to clarify that filtering should only be done by Id only, not by name.

Working with the Eng team to take a further look at this, will post any updates here :slight_smile:

1 Like

Hi @VictorMonteiro7 - let me know if you can try this out now, the thread should be retrieved by folder id :slight_smile: