Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Keyword "Competitor" seem to break plugin #83

Closed
johnathanz opened this issue Jun 26, 2023 · 4 comments
Closed

Keyword "Competitor" seem to break plugin #83

johnathanz opened this issue Jun 26, 2023 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@johnathanz
Copy link

Before reporting the issue, did you ?

  • [X ] Update your notionSpaceId and cookie value in Alfred Settings. If you don't know how to do this, check this

Describe the bug
When I query the Notion plugin with certain keywords, I get a 'NoneType' object is not subscriptable error.

Issue seem to be quite specific to the keyword "Competitor".

To Reproduce
Steps to reproduce the behaviour:

  1. invoke plug in with NS <keyword>
  2. See error

Expected behaviour
Would expect to see notion pages containing "Competitor"

Screenshots
2023-06-26 at 20 56 47@2x

Workflow (please complete the following information):

  • Version v0.5.3-alfred5

Additional context
When I query for "competit" instead of "competitor", the right results does show up, but it seems to cap at 3 results (querying Notion itself gives about 20+ results)
2023-06-26 at 21 00 22@2x

Searching in notion:
2023-06-26 at 21 03 15@2x

@wrjlewis
Copy link
Owner

wrjlewis commented Jul 4, 2023

Hi @johnathanz

This is an interesting one and looks like a genuine bug. I'm presuming you have something in your search results that is a bit unusual and that the alfred code is not expecting.

In your normal notion search results for 'competitor' is there anything that stands out? Anything to do with the new projects and tasks feature perhaps.

The code is breaking on line 320, I think it's trying to pass through an icon url that that isn't there.

I'd guess there is a collection_view type page in your search results which does not have an icon, and the code is expecting one and trying to process, which produces the error you are seeing and stops any further results from showing.

Are you able to change the code in your 'notion.py' file? It will be stored in your alfred preferences location, there is a workflows folder. If so, let me know if changing the above, to look like this, has the right effect?

Replace line 320 with the following 3 lines: (the third line should be one tab out from the line above it, ie idented out)

iconUrl = searchResults.recordMap.get('collection').get(collectionPointerId).get('value').get('icon')
if iconUrl is not None:
    searchResultObject.icon = geticonpath(searchResultObject.id, searchResults.recordMap.get('collection').get(collectionPointerId).get('value').get('icon'))

@wrjlewis wrjlewis self-assigned this Jul 4, 2023
@wrjlewis wrjlewis added the bug Something isn't working label Jul 4, 2023
@johnathanz
Copy link
Author

Hi @wrjlewis your recommended changes fixed it.

Pages I was looking up were across both Private and Teamspaces. Within Teamspaces, we have a number of pages, tasks, projects, tables that may not have icons.

Great job on diagnosing this 👍

Thanks again!

@wrjlewis
Copy link
Owner

wrjlewis commented Sep 2, 2023

Hi @johnathanz , this has now been fixed in the above two releases 👍

Let me know if you get any more issues relating to this

Thanks

@wrjlewis wrjlewis closed this as completed Sep 2, 2023
@johnathanz
Copy link
Author

It's been a couple of weeks & running very well.
Thanks @wrjlewis. Really appreciate your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants