rstudio / pins-r

Pin, Discover and Share Resources
https://pins.rstudio.com
Other
301 stars 62 forks source link

Pins published to Connect sometimes include username in name and sometimes do not #797

Open juliasilge opened 8 months ago

juliasilge commented 8 months ago

When you write a pin to Connect, the displayed name changes depending on whether the last write did or did not include the username.

Screenshot 2023-10-31 at 1 18 42 PM

i.e. this reflects me doing pin_write(board, x, "fabulous_numbers") and pin_write(board, x, "julia.silge/superb_numbers"). I can change how either one displays by including (or not including) my username. I believe we should always include the username rather than switch back and forth.

As a reminder, pins for Python requires Connect users to include their username when writing and does not try to look up who they are.

juliasilge commented 7 months ago

This happens because default_title() gets called before any board-specific methods:

https://github.com/rstudio/pins-r/blob/a3e52c78e799d24359b72dffd4cac33a7bc0fe98/R/pin-read-write.R#L119

We don't have a chance to check/change name before the metadata is set up.