lemonstand / lemonsync

A command line tool to work on LemonStand themes locally.
Other
1 stars 0 forks source link

LemonSync connection fails with missing edit_theme #17

Open tomcornall opened 8 years ago

tomcornall commented 8 years ago

Editing theme name missing causes exception message, like:

File "/usr/local/bin/lemonsync", line 9, in <module>

load_entry_point('lemonsync==0.1.19', 'console_scripts', 'lemonsync')()

File "build/bdist.macosx-10.11-x86_64/egg/lemonsync/LemonSync.py", line 156, in main

File "build/bdist.macosx-10.11-x86_64/egg/lemonsync/LemonSync.py", line 96, in run_utils

File "build/bdist.macosx-10.11-x86_64/egg/lemonsync/Utils.py", line 57, in file_changes

TypeError: sequence item 2: expected string or Unicode, NoneType found
Issues:
  1. LemonSync is expecting a value without checking first
  2. Connection allows null value to go through
    To Do:

Check value Emit error if check fails (before connection) Figure out how to set the value

See: https://github.com/lemonstand/lemonsync/blob/master/lemonsync/Utils.py#L57

ChrisZieba commented 8 years ago

Does the api call '/api/v2/identity/s3' return a null value for theme? Isn't there always suppose to be a theme that is being actively edited? If so, I would edit that api response to return a non 200 if there is no theme.

tomcornall commented 8 years ago

@ChrisZieba Yes a null value is returned. I agree it shouldn't respond with 200 - should check the theme before making the connection.

robotpony commented 8 years ago

There is an active theme, just not an editing theme. Both the API and lemonsync are at fault:

ChrisZieba commented 8 years ago

The call to /api/v2/identity/s3 in Connector shouldn't event return the theme and bucket - it;s used to return a signed url I think. That should be a separate call. Those endpoints might even exist in the API.

robotpony commented 8 years ago

We haven't changed it, it's however it was when you left ;-)

ChrisZieba commented 8 years ago

Yes Bruce, I'm aware. I was simply giving some constructive feedback for the design :)

DavidOliver commented 8 years ago

I'm a new user of LemonSync and am getting this TypeError. My store seems to have a theme activated and marked as editing. As far as I remember, I've never edited the theme name, which is La Boutique (API code laboutique). I've just exported it, and the name in theme.yaml matches the online theme name.


screenshot from 2016-01-16 17 11 04

screenshot from 2016-01-16 17 30 35

My lemonsync.cfg:

[api]
api_host = https://ald.lemonstand.com
api_key = ...
api_access = ...

[dir]
watch_dir = /media/Storage/Work/Work/Advanced Lighting Direct/Website/Theme
file_patterns = [ "*" ]
ignore_patterns = [ "*.tmp", "*.TMP", "*/.git*", "*.DS_STORE" ]

[store]
store_host = ald.lemonstand.com

I'm running the Linux version. Python 2.7.6.

Does anyone know how I can get LemonSync working? Thanks.

tomcornall commented 8 years ago
Reproduced:
Steps to solve:

Fill in edit_theme with default value (zest currently) during store creation

tomcornall commented 8 years ago

Another instance of this: https://app.intercom.io/a/apps/7236196445273cea007287c0c90a2f0d598567cc/inbox/conversation/2048930276

tomcornall commented 8 years ago

NOTE: Simple fix by clicking Make currently editing in store dashboard in the meantime