Table of Contents
Describe the bug
Steps to reproduce the behavior
Expected vs actual behavior
Logs
Changes
Before
After
The Problem
Proposed solution
Home Web Front-end JS Tutorial Doing More Open Source Stuff: Making Up For Lost Time

Doing More Open Source Stuff: Making Up For Lost Time

Dec 17, 2024 pm 04:53 PM

Doing More Open Source Stuff: Making Up For Lost Time

I've been a bit busy lately, and sadly haven't had much time to contribute to open source. I was looking forward to getting back on track, but ran into some hitches. In my last post, I discussed how I was set to dive into Mattermost Mobile and implement the same feature I previously worked on for the webapp - adding a setting to toggle rendering emoticons (:D) as emojis (?) - but I had to very quickly give up on that idea. Turns out WSL (Windows Subsystem for Linux) is not all that great for mobile development.

"Couldn't Be That Hard.."

Development for Mattermost is officially only supported for MacOS and Linux. This wasn't a problem when working on the webapp. While I was working on the web app, I was able to use WSL, and everything worked flawlessly. But when I tried to start working on the mobile app, I ran into problem after problem.

Following the dev environment setup instructions for Linux, I needed to set up an Android emulator, but trying to run one inside WSL didn't work - it wouldn't detect the emulator. I also couldn't just develop on Windows because the pre-install script ran a .sh script. So I spent a couple days trying to connect from inside WSL to the Android emulator running on Windows, to no avail - it just wouldn't appear in the list of emulators in WSL. I spent hours pouring over forum posts and GitHub gists, but it seemed like it just wasn’t going to work out.

I also tried forwarding my own device's USB connection to WSL to try and develop on my device. Supposedly, usbipd-win should make this work, as mentioned in this article on Microsoft Learn, and yet every time I'd retry forwarding my device to WSL, the list of connected devices would come up empty.

I searched through the message history in the official Mattermost Contributors chat, but all I found were posts from other people struggling with the same thing. So I figured the last thing I could try was to make my own post and ask for help, which thankfully, somebody did respond to to try and help, but unfortunately they were not on the mobile team and directed me to try asking in the mobile team's chat, where I've yet to receive a response.

So unfortunately, for the immediate future it seems like I won't be able to work on the issue.

Trying Something Else

In the meantime, I've been looking to pick up some other issues. While browsing for issues labelled "help wanted", I found this issue for the GitHub CLI:

Doing More Open Source Stuff: Making Up For Lost Time `gh run view` should list branches in square brackets #10038

Doing More Open Source Stuff: Making Up For Lost Time
BagToad posted on

Describe the bug

gh run view lists branches in parenthesis, but I think it should list them in square brackets to align with Primer guidelines:

Display branch names in brackets and/or cyan

Steps to reproduce the behavior

gh run view

Expected vs actual behavior

gh run view prompts should display branches within square brackets.

Logs

❯ gh run view
? Select a workflow run  [Use arrows to move, type to filter]
> - Verifying attestations offline fails, Discussion Triage (trunk) 4h55m1s ago
  - Decoding, Discussion Triage (patch-1) 4h59m32s ago
  ✓ Decoding, PR Automation (patch-1) 4h59m43s ago
  ✓ Issue Automation, Issue Automation (trunk) 5h20m31s ago
  - `gh repo rename myorg/newname` results in `myorg/myorg-newname`, Discussion Triage (trunk) 10h13m50s ago
  - 401 Error at every turn, Discussion Triage (trunk) 10h15m20s ago
  - 401 Error at every turn, Discussion Triage (trunk) 10h15m20s ago
Copy after login
View on GitHub

It seemed like a fairly straightforward change and I thought it'd be a nice break from the colossal issues I'd been undertaking - something to put me back on a decent pace again.

I was pleased with how simple the dev setup was. I already had Go installed, so all I had to do was compile the binary.

I read the contributing docs which were also very helpful and helped me get started on figuring out where to find the relevant code. I spent a little while looking through it, and found the function responsible for displaying branch names in the run command. I'd never really written Go before, but it felt very reminiscent of C's printf(). I made the change and opened a PR, but in the excitement I forgot to update the tests, which I was reminded of by a reviewer.

Doing More Open Source Stuff: Making Up For Lost Time fix: list branches in square brackets in `gh run view` #10043

Doing More Open Source Stuff: Making Up For Lost Time
uday-rana posted on

Fixes #10038

Changes

pkg/cmd/run/shared: Switched parentheses in selectRun() to square brackets.

Before

func selectRun() {
  ...
  fmt.Sprintf("%s %s, %s (%s) %s", ...)
  ...
}
Copy after login
Enter fullscreen mode Exit fullscreen mode

After

func selectRun() {
  ...
  fmt.Sprintf("%s %s, %s [%s] %s", ...)
  ...
}
Copy after login
Enter fullscreen mode Exit fullscreen mode
View on GitHub

I dug through the tests, identified the failing ones, and updated them. Unfortunately, I was then notified by a maintainer that they were in fact still in the process of triage for this issue and had preemptively applied the "help wanted" label, and that my PR may not be merged. I was a little disappointed, but I figured I'd done my part so it wasn't a big deal.

Doing More Open Source Stuff: Making Up For Lost Time Comment for #10038

Doing More Open Source Stuff: Making Up For Lost Time
BagToad commented on

? Hey @uday-rana, thanks for your interest picking this up!

I'd like to wait for this issue to get triaged by our first responder person on rotation this week.

I was probably too eager when adding the Help Wanted label - I still want our first responder person to triage this to ensure we agree on the work before implementing it ❤ ?

I don't foresee any issues, but I'm letting you know anyways so you know what we are waiting for before one of us reviews the PR. If our first responder person agrees, then we'll happily accept a PR ?

Apologies for the confusion! In the future, I won't add these labels early - this unintentionally skipped our triage process ?

View on GitHub

Round Two

While looking through GitHub for more issues to work on with the "help wanted" label, I found yet another Mattermost issue, this time for the webapp. Since I'd already set up the dev environment for the webapp, I figured I could quickly spring into action.

Doing More Open Source Stuff: Making Up For Lost Time Add timestamp to pasted image filenames to differentiate them #29524

Doing More Open Source Stuff: Making Up For Lost Time
mattermod posted on

The Problem

When pasting an image from the clipboard into the message input, it gets the filename image.png. If multiple images are pasted, they all get the same image.png filename. This can be a problem when downloading each file with the same name with danger of overwriting.

Proposed solution

Auto-generate a Filename that includes the timestamp with this format:

image-2024-11-18-6-29-57-PM

Mattermost thread: https://hub.mattermost.com/private-core/pl/xryg3tedg3bbxq3xuwnrj9ymyc


If you're interested please comment here and come join our "Contributors" community channel on our daily build server, where you can discuss questions with community members and the Mattermost core team. For technical advice or questions, please join our "Developers" community channel.

New contributors please see our Developer's Guide.

JIRA: https://mattermost.atlassian.net/browse/MM-62003

View on GitHub

I'm looking into this issue as of writing this blog post and I've identified the source of the problem. When posting an image from the clipboard in a browser or browser-like (a la Electron app) environment, if the image doesn't have a name, the browser will automatically give it the name "image.png". I've tested this with Firefox and Edge and it holds true for both. Why is this a problem? The app already has logic that adds timestamps to unnamed files. But since these images are automatically given names when pasting from the clipboard, the timestamps don't get set.

The easiest solution would be to just hardcode a check for the name 'image.png'. But I'm wondering what happens if the image isn't a PNG? Is that even possible in the clipboard? And what if the user is uploading a file actually named "image.png"? This is something I'll have to discuss with the developers.

Either way, I'm determined to fix this issue. Here's hoping things go smoothly.

The above is the detailed content of Doing More Open Source Stuff: Making Up For Lost Time. For more information, please follow other related articles on the PHP Chinese website!

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

What should I do if I encounter garbled code printing for front-end thermal paper receipts? What should I do if I encounter garbled code printing for front-end thermal paper receipts? Apr 04, 2025 pm 02:42 PM

Frequently Asked Questions and Solutions for Front-end Thermal Paper Ticket Printing In Front-end Development, Ticket Printing is a common requirement. However, many developers are implementing...

Who gets paid more Python or JavaScript? Who gets paid more Python or JavaScript? Apr 04, 2025 am 12:09 AM

There is no absolute salary for Python and JavaScript developers, depending on skills and industry needs. 1. Python may be paid more in data science and machine learning. 2. JavaScript has great demand in front-end and full-stack development, and its salary is also considerable. 3. Influencing factors include experience, geographical location, company size and specific skills.

Demystifying JavaScript: What It Does and Why It Matters Demystifying JavaScript: What It Does and Why It Matters Apr 09, 2025 am 12:07 AM

JavaScript is the cornerstone of modern web development, and its main functions include event-driven programming, dynamic content generation and asynchronous programming. 1) Event-driven programming allows web pages to change dynamically according to user operations. 2) Dynamic content generation allows page content to be adjusted according to conditions. 3) Asynchronous programming ensures that the user interface is not blocked. JavaScript is widely used in web interaction, single-page application and server-side development, greatly improving the flexibility of user experience and cross-platform development.

How to merge array elements with the same ID into one object using JavaScript? How to merge array elements with the same ID into one object using JavaScript? Apr 04, 2025 pm 05:09 PM

How to merge array elements with the same ID into one object in JavaScript? When processing data, we often encounter the need to have the same ID...

How to achieve parallax scrolling and element animation effects, like Shiseido's official website?
or:
How can we achieve the animation effect accompanied by page scrolling like Shiseido's official website? How to achieve parallax scrolling and element animation effects, like Shiseido's official website? or: How can we achieve the animation effect accompanied by page scrolling like Shiseido's official website? Apr 04, 2025 pm 05:36 PM

Discussion on the realization of parallax scrolling and element animation effects in this article will explore how to achieve similar to Shiseido official website (https://www.shiseido.co.jp/sb/wonderland/)...

The difference in console.log output result: Why are the two calls different? The difference in console.log output result: Why are the two calls different? Apr 04, 2025 pm 05:12 PM

In-depth discussion of the root causes of the difference in console.log output. This article will analyze the differences in the output results of console.log function in a piece of code and explain the reasons behind it. �...

Is JavaScript hard to learn? Is JavaScript hard to learn? Apr 03, 2025 am 12:20 AM

Learning JavaScript is not difficult, but it is challenging. 1) Understand basic concepts such as variables, data types, functions, etc. 2) Master asynchronous programming and implement it through event loops. 3) Use DOM operations and Promise to handle asynchronous requests. 4) Avoid common mistakes and use debugging techniques. 5) Optimize performance and follow best practices.

How to implement panel drag and drop adjustment function similar to VSCode in front-end development? How to implement panel drag and drop adjustment function similar to VSCode in front-end development? Apr 04, 2025 pm 02:06 PM

Explore the implementation of panel drag and drop adjustment function similar to VSCode in the front-end. In front-end development, how to implement VSCode similar to VSCode...

See all articles