Git hub saver

118 visualizzazioni
Passa al primo messaggio da leggere

Ste

da leggere,
24 dic 2020, 14:10:5524/12/20
a TiddlyWiki
I'm sure it's my own muppetry and that I'm trying to do this on my phone but, I can succesfully upload pre upgrade wiki but not post upgrade wiki to github using the git hub saving mechanism. I am getting a 404 error. Any one else finding this?

Saq Imtiaz

da leggere,
24 dic 2020, 14:24:5724/12/20
a TiddlyWiki
Long shot, but whatever is entered for "target branch", remove it and re-enter. Check your repo to make sure you have the right branch name (master/main).

Ste

da leggere,
24 dic 2020, 14:25:2224/12/20
a TiddlyWiki
Just reread my own post.. Let me clarify... Using the git hub saving in tiddlywiki works in pre release but not from newly upgraded. This is true both with the file on my phone or the new file uploaded to git hub and trying the github saver from there. 
XMLHttpRequest error code: 401
Sorry. It's a 401. Not a 404.. I'm losing the plot.. Mulled wine time! 

Ste

da leggere,
24 dic 2020, 14:30:5024/12/20
a TiddlyWiki
Cheers Saq! 
Refilled in all fields and for some reason.. It works..! 

Saq Imtiaz

da leggere,
24 dic 2020, 14:33:1524/12/20
a TiddlyWiki
Hmm. I am a bit surprised that worked. I wonder if the changes made to the Github saver to reflect the change made by Github to the default branch  (master vs main) got something wrong.

Saq Imtiaz

da leggere,
24 dic 2020, 14:37:5624/12/20
a TiddlyWiki
Yep, we have our first bug. The placeholder shown when the branch has not been specified is "master", but the code uses "main" for the branch.

The interim fix for users is fortunately easy, just empty and re-fill the branch name.

Mark S.

da leggere,
24 dic 2020, 14:46:3924/12/20
a TiddlyWiki
I don't understand. My branch was specified (it shows as "master" in the saver panel). But I had to delete it and type it in again to get it to work. So is there an internal 5.1.23 configuration file that has to be overwritten?

Thanks! 

Saq Imtiaz

da leggere,
24 dic 2020, 14:49:5924/12/20
a TiddlyWiki
@Mark S

I posted some details in the issue I created for this: https://github.com/Jermolene/TiddlyWiki5/issues/5317

The text you see is from the default attribute of the <$edit-text> in the UI, see https://github.com/Jermolene/TiddlyWiki5/blob/master/core/ui/ControlPanel/Saving/GitHub.tid#L13

When the underlying tiddler does not exist:
- the UI shows the branch as "master".
- the code after the recent changes, uses "main" instead.

Mark S.

da leggere,
24 dic 2020, 15:59:2324/12/20
a TiddlyWiki
So I guess that configuration tiddler $:/GitHub/Branch was added to 5.1.23 (it doesn't seem to be in 5.1.22) ?
I'm trying to understand why my existing configuration didn't persist through the upgrade process, no matter
what the default attribute provided. All the other configurations (path, api, repository, file name) persisted.

Saq Imtiaz

da leggere,
24 dic 2020, 16:17:4724/12/20
a TiddlyWiki
I would wager you never entered a value for the branch, but rather used the displayed default which is pre-filled as "master". 
Thus the $:/Github/Branch tiddler was never created in your wiki (it isn't new for 5.1.23). Like all the other tiddlers for the Github saver, it is only created when you enter a value.

Have a look at https://tiddlywiki.com/empty.html#%24%3A%2FControlPanel to see what I mean, the branch is pre-filled with a default value. Even backspacing by a single character and then re-typing it will actually create the tiddler. 

Now in 5.1.23 the displayed default value ("master"), and the default actually used by the saver ("main" in 5.1.23 whereas it used to be "master" in 5.1.22) are no longer the same, causing the save to fail.

Personally I think the pre-filled default value is deceiving and we should not use one. I've had similar issues in other contexts where the <$edit-text> widget gives the appearance that a tiddler exists but it just the default value being shown in the absence of the tiddler.

Mark S.

da leggere,
24 dic 2020, 17:53:1124/12/20
a TiddlyWiki
On Thursday, December 24, 2020 at 1:17:47 PM UTC-8  wrote:
I would wager you never entered a value for the branch, but rather used the displayed default which is pre-filled as "master". 
Thus the $:/Github/Branch tiddler was never created in your wiki (it isn't new for 5.1.23). Like all the other tiddlers for the Github saver, it is only created when you enter a value.


I'm not talking about a brand-new setup on Github. I'm talking about an existing one. So all the fields already had values. 

My TW was 5.1.21. It was on github and saving there. All the saver fields were filled in. I downloaded it, upgraded it, and then filled in the authorization token. ALL the other fields were showing their original values. But it wouldn't save -- until I wrote over the branch "master" with the word "master".  I did not need to write over any of the other saver fields.
 
So, if $:/Github/Branch already existed, did it get stripped out during the upgrade? Why wasn't it used, just like the path, repository, api fields ?

Saq Imtiaz

da leggere,
24 dic 2020, 18:14:5224/12/20
a TiddlyWiki

I'm not talking about a brand-new setup on Github. I'm talking about an existing one. So all the fields already had values. 

As am I. I suggest re-reading my previous message with this in mind, as well as last looking at the links provided here and in the GitHub issue. An input field being filled in does not necessarily mean the underlying tiddler exists and has a value.

Il messaggio è stato eliminato

Mark S.

da leggere,
24 dic 2020, 18:56:2624/12/20
a TiddlyWiki
Ok, think I got it.

When I go back to my last commit from 3 months ago, I see that there is no


So, I guess what you're saying is that we didn't need $:/GitHub/Branch before and therefore I never created it (because the default was good enough).

The new question is, can we now save on any branch that we want? Like can I have a "test" branch for experiments before moving to main/master ?

Thanks!

On Thursday, December 24, 2020 at 3:41:28 PM UTC-8 Mark S. wrote:
On Thursday, December 24, 2020 at 3:14:52 PM UTC-8 wrote:

As am I. I suggest re-reading my previous message with this in mind, as well as last looking at the links provided here and in the GitHub issue. An input field being filled in does not necessarily mean the underlying tiddler exists and has a value.

But ... it was working with 5.1.21. The field must have been filled in or it wouldn't have worked. So how did it become unfilled? 

I understand that just because a value is displayed doesn't mean there is an underlying tiddler. But when and why did it disappear? It was there previously, or it would not have been able to save.

> I would wager you never entered a value for the branch, but rather used the displayed default which is pre-filled as "master".
 
Why would I need to enter a branch value, when it already had one in it's prior use on github? It not only APPEARED to have the field filled in, it must have actually had the tiddler filled in or it would never have saved. Or does the upgrade process strip out existing configuration?
 
In other words, why doesn't the underlying tiddler exist, or why wasn't it used? I did not download "empty" and then try to save it. I was using an existing TW on github which should already have had all fields filled in.

Saq Imtiaz

da leggere,
24 dic 2020, 19:07:0824/12/20
a TiddlyWiki
So, I guess what you're saying is that we didn't need $:/GitHub/Branch before and therefore I never created it (because the default was good enough).

Precisely. The default value in 5.1.21 shown in the UI for the saver is what you wanted, so you never edited it and $:/Github/Branch was never created. The UI and the JS used the same default ("master") and saving worked fine.

Now in 5.1.23 you still get shown the same default in the UI ("master"), but the JavaScript uses another ("main"). Editing the branch name in the UI creates the $:/Github/Branch tiddler, so that is used instead of the JavaScript default value.
 
The new question is, can we now save on any branch that we want? Like can I have a "test" branch for experiments before moving to main/master ?

I believe we have always been able to save to any branch we want. The only limitation is that only one branch for a given repository can be published via github pages to be served over HTTP, which is a github limitation and not one coming from TiddlyWiki. 

Apologies if I haven't been the most eloquent today, I am probably a little bit too exhausted to be explaining things.
Regards,
Saq

Mark S.

da leggere,
24 dic 2020, 21:57:2924/12/20
a TiddlyWiki
On Thursday, December 24, 2020 at 4:07:08 PM UTC-8 wrote:


I believe we have always been able to save to any branch we want. The only limitation is that only one branch for a given repository can be published via github pages to be served over HTTP, which is a github limitation and not one coming from TiddlyWiki. 


Ah, that is what it was. I knew there was something.
 
Apologies if I haven't been the most eloquent today, I am probably a little bit too exhausted to be explaining things.

'Tis the season to be harried ...
 
Rispondi a tutti
Rispondi all'autore
Inoltra
0 nuovi messaggi