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)

Hot Topics

Java Tutorial
1664
14
PHP Tutorial
1266
29
C# Tutorial
1239
24
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.

The Evolution of JavaScript: Current Trends and Future Prospects The Evolution of JavaScript: Current Trends and Future Prospects Apr 10, 2025 am 09:33 AM

The latest trends in JavaScript include the rise of TypeScript, the popularity of modern frameworks and libraries, and the application of WebAssembly. Future prospects cover more powerful type systems, the development of server-side JavaScript, the expansion of artificial intelligence and machine learning, and the potential of IoT and edge computing.

JavaScript Engines: Comparing Implementations JavaScript Engines: Comparing Implementations Apr 13, 2025 am 12:05 AM

Different JavaScript engines have different effects when parsing and executing JavaScript code, because the implementation principles and optimization strategies of each engine differ. 1. Lexical analysis: convert source code into lexical unit. 2. Grammar analysis: Generate an abstract syntax tree. 3. Optimization and compilation: Generate machine code through the JIT compiler. 4. Execute: Run the machine code. V8 engine optimizes through instant compilation and hidden class, SpiderMonkey uses a type inference system, resulting in different performance performance on the same code.

Python vs. JavaScript: The Learning Curve and Ease of Use Python vs. JavaScript: The Learning Curve and Ease of Use Apr 16, 2025 am 12:12 AM

Python is more suitable for beginners, with a smooth learning curve and concise syntax; JavaScript is suitable for front-end development, with a steep learning curve and flexible syntax. 1. Python syntax is intuitive and suitable for data science and back-end development. 2. JavaScript is flexible and widely used in front-end and server-side programming.

JavaScript: Exploring the Versatility of a Web Language JavaScript: Exploring the Versatility of a Web Language Apr 11, 2025 am 12:01 AM

JavaScript is the core language of modern web development and is widely used for its diversity and flexibility. 1) Front-end development: build dynamic web pages and single-page applications through DOM operations and modern frameworks (such as React, Vue.js, Angular). 2) Server-side development: Node.js uses a non-blocking I/O model to handle high concurrency and real-time applications. 3) Mobile and desktop application development: cross-platform development is realized through ReactNative and Electron to improve development efficiency.

How to Build a Multi-Tenant SaaS Application with Next.js (Frontend Integration) How to Build a Multi-Tenant SaaS Application with Next.js (Frontend Integration) Apr 11, 2025 am 08:22 AM

This article demonstrates frontend integration with a backend secured by Permit, building a functional EdTech SaaS application using Next.js. The frontend fetches user permissions to control UI visibility and ensures API requests adhere to role-base

Building a Multi-Tenant SaaS Application with Next.js (Backend Integration) Building a Multi-Tenant SaaS Application with Next.js (Backend Integration) Apr 11, 2025 am 08:23 AM

I built a functional multi-tenant SaaS application (an EdTech app) with your everyday tech tool and you can do the same. First, what’s a multi-tenant SaaS application? Multi-tenant SaaS applications let you serve multiple customers from a sing

From C/C   to JavaScript: How It All Works From C/C to JavaScript: How It All Works Apr 14, 2025 am 12:05 AM

The shift from C/C to JavaScript requires adapting to dynamic typing, garbage collection and asynchronous programming. 1) C/C is a statically typed language that requires manual memory management, while JavaScript is dynamically typed and garbage collection is automatically processed. 2) C/C needs to be compiled into machine code, while JavaScript is an interpreted language. 3) JavaScript introduces concepts such as closures, prototype chains and Promise, which enhances flexibility and asynchronous programming capabilities.

See all articles