For this pull request for release 2, I have done a pull request for a project that is called vgstation13. I have chosen this as my bug to do due to time constraint I have for brave. Although I will be going over all the details or information that I have gathered over the course of time while researching my bug.
Introduction to vgstation13
But first I must explain what vgstation13 is. This project was originally based on something called Space Station 13. It runs off from a platform called BYOND. This is basically a requirement if you wish to play/develop the game. Although it’s based on a game called Space Station 13 the game does not take itself not too serious compared to the original.
While in the game you can pick any class you desire to choose but if that role has been already picked it will then assign you another role. The game from the outside looks very simple but it has a very complex system behind it. Each player that enters the game has to play their role, what they are needed to do will depend on what role the player has chosen or given.
A simple way to say what this game is, it is a Space Station simulator, the player is simulated in an outer space environment, and are given tasks that they must do in order to make money and survive. There will be other events that can occur like murders, an experiment that went wrong creating mutants, and anything you can probably think of in a sci-fi game.
The bug that I have fixed a very simple one as it was just a request to remove codes that were not needed.
The issue can be found at the following link:
https://github.com/vgstation-coders/vgstation13/issues/10777
As requested by them, it was to remove a certain disease call Plasmoid. And that the file was last updated on 23rd August 2010. That itself was very easy to fix as they also linked where the bug was at.
To fix the code we just need a couple of files installed:
The first thing we must installed is BYOND and there you must also create an account to login with.
After installation of BYOND, you will be required to sign in on the client. Once those things are completed you will have something like this:
When everything is done all you have to do is close the client and it will minimize the client. There isn’t anything else you need to do here in this client but there are other games that you can install on the left side from the list.
Our next step is to download the source files. You can find the project file from here: https://github.com/vgstation-coders/vgstation13
Once that is completed, you will have to modify some config files. You will need to open the filename config-example within the project. In that folder, you will find a folder named admin_rank.
An example of where the file could be found is here:
D:\Github\vgstation13\config\admin_ranks.txt or
D:\Github\vgstation13\config-example\admin_ranks.txt
Inside the file, you want to copy
Game Master
and that’s all.
Next, we will need to go to the other config file and find the file name admins.txt.
In the text file, all you have to do is enter your username and paste and give yourself the Game Master role. Don’t worry this won’t affect the game! This is only needed for us to do our testing.
Then, we must go back and run the following executable:
vgstation13.dme
Once that is run you will get a client like above. The client below that are shown will be our code editor and way to access other files.
Then you must click build >> compile. The compilation will be quite slow on your first compile.
Once you are done compiling do the same thing but click on run instead.
When the client finish running you will get another client that has all the things you need:
Here is the client that you will be using a local server and game. All that is left to do is to create a character and set your occupation as a Captain to high and save. When everything is finally completed you will need to declare ready and go to the server panel and select “Start Now”.
When everything is up and running you will see this screen:
This is the testing interface that we will use for our testing purposes. There are many things you can do as an admin so you can play around and get used to the control and how to use other things to fix help other bugs.
To fix our code we will need to go to the following paths and delete the codes
The path can be found in:
code/datums/diseases/plasmatoid.dm
Next, we will also have another line that calls this function in vgstation13.dme:
In this screen, all you have to do is delete the include line and we are done with this bug.
Brave PDF.js
Finally, we will be talking about Brave. But more specifically I will be talking about PDF.js. This was the original bug that I was planning on doing but due to time constraint I will not be able to do this but hopefully, I will be able to complete this as a follow up for Release 3 that will be coming up!
Introduction to Bug
Firstly, if we can reproduce the bug. Luckily the issue that we are working with has a pdf file that we can use for a testing purpose.
http://mei.org.uk/files/papers/C3_2016_June.pdf
The issue says only certain PDF file will not render everything part of the document. But instead, render blank spaces. Let us see if we can re-create this.
It does seem like it doesn’t render a lot of words beside the first couple of them. But to be sure that this isn’t just a PDF file problem let run it on another browser like FireFox.
Huh.. From what it looks like it doesn’t seem to be the PDF itself so it must be something like the pdf reader. If we go back to the Brave we can actually highlight the blank spaces.
and if you right click the blue lines you can actually get what actually written on the page.
This investigation rules out one possibility, which is the pdf reader not reading the actual lines.
Research
While researching about how to fix this bug I stumble upon a couple of key information that can help me with fixing my bug.
How I figure where I want to find where I wanted to work on was to find anything that has to do with PDF.
Few things that I did was do a search in the GitHub search engine, and by doing the grep command from the terminal.
Some of the files that got my interest was PDF.js and PDFJS.js.
/* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
* You can obtain one at http://mozilla.org/MPL/2.0/. */
This here tells us that the original source code came from Mozilla. This also tells us where to search when we need more information.
https://github.com/brave/browser-laptop/blob/master/app/pdf.js
The first file I looked at was pdf.js. While looking at this there are a few things that come to mind. The first thing is renderToPdf, from what we saw during the investigation it seems that it’s not rendering properly so this might be the thing that can help us. But we can come back to this later but we should check the other PDFjs.js to check to see if anything else will help us out.
https://github.com/brave/browser-laptop/blob/master/app/pdfJS.js
This file doesn’t look too useful as it checks if the file is a pdf or not and pdf’s properties. So let’s go back to pdf.js to see if we find any more interesting thing that can help us.
While going back to pdf.js I figure why not look at the Mozilla code and see if there are any changes that they made that can help us. Consider they did use their as a base to create the pdf.
When looking for Mozilla pdf.js the first link that was shown was to Mozilla’s GitHub:
https://github.com/mozilla/pdf.js
Then we start looking for something like a file called pdf.js. And luckily we were able to find it in the src file:
https://github.com/mozilla/pdf.js/blob/master/src/pdf.js
On first glance at this code, it looks completely different from the pdf.js in Brave. Brave’s pdf.js contains one functions module while Mozilla’s pdf.js contains many functions and required that it uses.
This got me thinking. What does Brave’s pdf.js do, after reading it a bit more I realized it was only used for rendering/display all the information it has gotten onto the page and that’s it.
Then I decide to actually check the Browser Developer Tools on Brave. And hold and behold. There’s were errors that were ignored during the tasks.
And if you look carefully there’s another file its using:
<pre>pdf.worker.js:344</pre>
This file was not there when I was searching with grep nor GitHub. So I decided to look into the page.
While looking at the pages, I decided to check out the other directories and see what there is. Within the content/build is another pdf.js. Wow, this is getting confusing having 4 different type of file name pdf. Things that I notice while debugging was that it looks like it loaded from a remote server of some sort.
Secondly, it seems to have the similar files in Mozilla’s pdf.js GitHub. But these files are not entirely the exact the same. So I started to think maybe similar bugs might have happened to Firefox before. After searching the web, I was able to find a couple of issues that were fixed. But they all lead back to Mozilla’s pdf.js.
So the bug was fixed around 4-5 months ago but the Brave’s pdf file was last updated 2 years ago. So technically all we need to do is merge the changes from Brave and Mozilla’s pdf.js file right?
Well, it’s not that as I stated above the pdf.js and pdf.worker.js file seems to somewhere in a remote server. So there isn’t a way for us to update the file as of now.
Currently, I’m trying to talk with the Brave team to see if we are able to update the pdf files to fix the bugs.
Overall, this was a very interesting and exhausting experience for my first real open-sources contribution to any projects. I had learned many new things and hopefully, I will be able to do a follow up to complete the PR for Release 3.