Sneezry / vscode-devto

https://marketplace.visualstudio.com/items?itemName=sneezry.vscode-devto
MIT License
15 stars 3 forks source link

Draft article breaks the extension #14

Closed ccoVeille closed 4 months ago

ccoVeille commented 4 months ago

I have a lot of pending articles.

There are ideas I started to work on.

Many have no text or tag yet, only a title.

I cannot use your extension because of that.

ccoVeille commented 4 months ago

I'm opening a PR to fix it

ccoVeille commented 4 months ago

Please note the issue can be related to one of my articles that is in draft.

I have draft article that are 2 years old, maybe the way the API replies could lead to that. I didn't look any further.

I can provide replicate steps if needed.

But I don't think validating the JSON is empty would be a problem, only the context, comment, or reason of why it occurs for me may be adapted

Sneezry commented 4 months ago

Hi @ccoVeille , could you provide the repo steps to create a draft without any content? I have tested on my side, however, I cannot create posts without any content:

image

ccoVeille commented 4 months ago

Welcome back, I hope you enjoyed your days off.

I think it's an old behavior, my draft articles are 2 years old.

Can you give me the exact API call that your application does ? I'll check with my API key.

I'm on my phone now.

Last time, I failed using VS Code Developer console to see the API calls in network.

Sneezry commented 4 months ago

The extension calls https://dev.to/api/articles/me/all to fetch all your posts, and pick the post with the selected id when you click the items in the tree view.

ccoVeille commented 4 months ago

I managed to replicate it easily

Here is what a post look alike

https://dev.to/ccoveille/test-for-sneezry-2719-temp-slug-1154266?preview=41397753595c0126a4847960dc1e90c6bbcdf349d254be6269da788de0eedb790dbb9fa3bfb39d79f93e3b9c1ddb067b660eba98244e79cfd22956f9

when using the API with https://dev.to/api/articles/me/unpublished, they will have this in common

"body_markdown": "",
Sneezry commented 4 months ago

I still cannot replicate this issue. Did I miss anything? I cannot find a text field to type the post title, instead, I can only set the title in the meta yaml section of the body part.

image

image

ccoVeille commented 4 months ago

You are using the advanced editor

Screenshot_20240508_143233_Forem.jpg

Go in settings then customization

ccoVeille commented 4 months ago

Fixed with #16, closing

Sneezry commented 4 months ago

I have released v0.0.14 with the fix, please upgrade the extension to verify if this issue has been resolved.

ccoVeille commented 4 months ago

It works !

Your fix is better than mine, as I can now see (maybe edit) the draft documents that have no content

ccoVeille commented 4 months ago

You might have to update this https://marketplace.visualstudio.com/items/sneezry.vscode-devto/changelog