Skip to content

Difficulties and Tips

Lasklu edited this page Aug 7, 2020 · 28 revisions

Here some tips for the next group

  1. Github-Workflow First of all you have to create an issue to each change. This is splitted into a feature request or a bug request. While creating the issue we provide a template with further instructions. You have the possibility to tag the issue or to assign somebody to this issue. After creating the issue you have to link a branch to it. The default branches "development" and "master" are protected. This means that you are only able to commit code to a feature (or bug)- Branch. Use this naming-convention: feature/GH-{issue-nr.} or bugfix/GH-{issue-nr.}.

    After pushing your code to the specific branch and resolving your issue you will merge this branch to the development branch. Create a self-describing pull request. To merge the branch your PR will have to fulfill two requirements:
  • Another person has to review your code
  • Every test (CI) has to be green
  1. Generated Squeak We explored automatically generating all messages which can be sent and received by TDLib via a C# project. Our progress can be seen here. Naming schemes still need to be adapted to comply with idiomatic squeak. We decided against including the code at that time as we had to setup initial concerns such as authorization. Now that this project gained some traction and more features future groups may decide there is worth in generating all classes.

  2. Functionality under MacOS We aimed for providing a stable Version of TelegramClient in Squeak for Ubuntu, Windows and MacOS, but had lots of difficulties under MacOS and decided to not provide support for MacOS as we have limited resources available. The Problem with MacOS is that we could not integrate the TDLib into our project and had difficulties using FFI to access the Library. The Library also didn't get write access to the OS filesystem and could not create dynamically generated resources.

  3. SAR File generation Sar files may be generated manually, but it is advisable to build on our automatic release. This is be used to automatically generate sar files on every sprint release. It requires all platform binaries to be stored into the TDLib folder inside the Resource folder of the squeak image.

  4. Multithreading In general you would use a seperate thread which runs in the background and received new messages from TDLib. FFI only supports one thread, so we had to use the processor yield function to switch between normal program execution and stopping the execution for a not noticeable amount of time to fetch new messages.

  5. Other errors we encountered a lot

  • external module not found: Your tdlib file might not be in the right place, look at FFIClient>>moduleName for the correct place. If it's there, it might not be downloaded completely or have the wrong name. Also try restarting Squeak. If none of that works try building the library yourself with infos from here (programming language must be C).
  • errors with ExternalLibraryFunction or other FFI-Classes: Your FFI-Version might not be supported. If you installed FFI by Squeak starting configuration or by the wrong command look in our setup guide.
  • Segfault when reopening the image: Try deleting the current tdlib file. Now the image should open with some error message. Abandon it. Now you can safely put the tdlib back at its place or download it again.
  • stuck on first authentication screen: You might have another TCUTelegram instance alive in your image, try closing it before restarting.
  • phone number is not accepted: You can only log in some finite amount of times with the same phone each day. Try using a different phone number or telegram's testing data center supported by TCTTestCore. Also consider taking a break ;)
Clone this wiki locally