Code Monkey home page Code Monkey logo

edlib's Introduction

About Me

Dave Murray's Dev Card

A long time ago, in a galaxy far, far away a small boy loved his 8-bit home micro. He learned to write games in BASIC and Z80 assembly language and dreamed of building his own astromech droid...

Hi, I'm Dave and I write code. In my career I've created solutions for a wide variety of industries. From industrial control systems for the electronics and automotive industries to GIS and statistical analysis software for the oil industry, software for call centres, the NHS and an SaaS ERP system for the catering industry. I currently work for a global engineering firm as lead developer for a suite of mobile apps built with Xamarin and provide support to other teams building .NET solutions.

When not writing code, my passion is watching motorcycle racing. From MotoGP to World Superbike, British Superbike, Dakar and the Africa Eco Race, where I sponsored a team in 2020, if it has two wheels and an engine I'll watch it race!๐Ÿ๐Ÿ๐Ÿ

  • ๐Ÿ‘จโ€๐Ÿ”ง I mostly work with C# and Xamarin
  • ๐Ÿ“ƒ I write a blog called Sailing the Sharp Sea
  • ๐Ÿ‘จโ€๐Ÿ’ป You can find me on GitHub
  • ๐Ÿ‘‹ Or LinkedIn
  • ๐ŸŽฌ Fun Fact: I was an extra in Blackadder!

Irongut's GitHub Stats

Featured Articles

Secure your workflows with StepSecurity Harden Runner ย  Secure your .NET builds with StepSecurity and GitHub Actions

edlib's People

Contributors

dependabot-preview[bot] avatar dependabot[bot] avatar irongut avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

edlib's Issues

Add BGS Tick

Move BgsTickService + required models, etc over from EliteALD.

  • Change the service to a singleton that parses & caches the data, returning a BgsTick type.
  • Add a LastUpdated property to the BgsTick model.
  • Add a method to return more than the most recent tick.

Requires:

  • Models/BgsTick.cs
  • Cache (for DownloadService) #2
  • DownloadService #4

Make the library linker safe

Some platforms (e.g. Xamarin iOS & Android) use a linker which can remove methods that are only used via reflection. Model constructors used by Json.Net for example, see #1.

A Preserve attribute can be added to classes & methods to prevent the linker removing them. To avoid a reference to a Xamarin library the attribute should be defined in the class library. The namespace of the attribute doesn't matter.

Examples:

References:

Documentation

Several forms of documentation will be needed; GitHub readme, GitHub Pages and Taranis website. XmlDoc comments generate an XML file on build that can be added to IntelliSense and various tools can conver them to other formats.

Plan

Generating a basic XmlDoc comment for every public method would save time. GhostDoc free version may be workable.

XML documentation for IntelliSense is generated from the comments on build.

Use DocFX to convert the XmlDoc comments into html as part of a pipeline. Will need some extra pages like FAQ & contributors guide.

Deploy the html to GitHub Pages.

Future

Use Hugo to generate static site docs and deploy to Taranis website. May need to use a sub domain to avoid rebuilding the whole site.

Galactic Standings is not link safe

Bug Report

Galactic Standings is not link safe.

To Reproduce

Steps to reproduce the behavior:

  1. Remove Taranis.EDlib from Skip Linking option.
  2. Run app & open Standings.
  3. Standing page shows 11 blank PowerViews.

Expected Behavior

Galactic Standings works without the linker having to skip EDlib.

Additional Context

Fix required for next EliteALD release.

Linked To

irongut/EliteALD Issue 301 Galactic Standings is not link safe

GalNet Feed Not Found

Bug Report

The json feed for GalNet has gone dark with server not found. An alternate rss feed is also dead.

Additional context

Other tools either use the same feed or scrape the html from the community site.

The community site contains Id, Title, PubDate, Body & Link fields.

Solution

EliteALD Backend will be expanded to scrape the community site and create a json blob on the Taranis api CDN.

Changes will be required in EDlib:

  • Modify NewsArticle object for fields available now.
  • Modify classification algorithm to remove Slug from text used.
  • Modify GalNetService to use new feed from Taranis CDN.
  • Ensure data is cached for 3 hours minimum.

Originally posted by @irongut in https://github.com/irongut/EliteALD/issues/323#issuecomment-850974937

Linked To

irongut/EliteALD#24 Add a searchable GalNet News Archive
irongut/EliteALD#28 Change GalNet News to a Carousel of articles
irongut/EliteALD#127 Increase Min SDK Version to 21
irongut/EliteALD#313 Version 2.0 Planning & Research
irongut/EliteALD#323 GalNet Feed Not Found

Improve network layer

The current architecture forces the use of DownloadService which includes caching features but not all apps will require the cache.

  • Create an IDownloadService interface.
  • Rename the current DownloadService to CachedDownloadService.
  • Use constructor injection in API services to pass the required implementation.
  • Create a new DownloadService that does not implement caching. Include the connectivity check.
  • Use the new DownloadService in the demo app + tests.
  • Create tests for download services.

Add links to API docs to EDlib docs

Feature Request

Add links to third-party API docs to the EDlib documentation; e.g. EDSM & INARA. Links to Taranis API docs can be added later if they ever exist.

Expected Behaviour

  • A link to the relevant docs should appear at the namespace level. See StackOverflow.
  • Links to specific API methods should be provided at class level (service & model).

Additional Context

INARA API already contains links at class level.

Linked To

#10 Add EDSM & Elite Status api
#11 Add INARA & Community Goals api
#70 Update readme & docs

Move Build Pipeline to GitHub

Feature Request

Currently EDlib is built on Azure DevOps but the project is simple enough to use a GitHub Actions build pipeline.

Expected Behaviour

See pipelines below.

Concerns

  • Finding / writing a script that can build & publish DocFX docs.
  • Azure Pipelines shows test code coverage, can Actions show coverage?

Linked To

#27 Create EDlib Nuget
#35 .Net 5 Compatibility
#73 Improve debugging experience
#76 Create a CD pipeline
irongut/EliteALD#305 Create Build Pipeline
irongut/CodeCoverageSummary

.Net 5 Compatibility

EDlib is compliant with .Net Standard 2.0. What is the best option to maintain compatibility with .Net Framework, .Net Core & Mono (Xamarin) while adding .Net 5 compatibility?

The test suite and demo project use .Net Core. Should additional demo projects be created to cover more platforms?

Options

  1. No change, .Net Standard 2.0 target should be compatible with .Net 5.
  2. Multi-target .Net Standard 2.0 and .Net 5.

Are there any advantages or disadvantages to each option?

Rework Storage Cache

Storage Cache

Currently handled at the lowest level by DownloadService.

Ideas

  1. Add a method to DownloadService that downloads without caching and move caching to EdsmService. This would be significantly different to the other APIs in the library.
  2. Add a method to DownloadService that implements the new cache strategy and use where relevant. This would keep the caching code in the same class.
  3. Replace the current caching code in DownloadService with the new strategy & use it everywhere. Some method calls will change & EliteALD will lose any cached data after upgrade to the new code but all apis would be consistent.

Strategy

Cache result & last updated using the method parameters (EdsmService) or request URL (DownloadService) in the key names. Return cached result if keys exist and have not expired.

Concerns

  • The method parameters or request URL can be quite long and could exceed the maximum length of a key name in the cache provided by the consuming app. Using a hash of the parameters / URL should prevent that while still being unique. SHA256 should be performant & reliable on all platforms.
  • Storage will eventually fill with expired results that have not been requested again. Consuming apps will need to periodically flush the cache of expired results.

Originally posted by @irongut in #10 (comment)

Add Cycles Since Turmoil to PowerStanding

Feature Request

Every Galactic Standings post on Mahon Reddit contains a table of Cycles Since Turmoil. Expand backend function to scrape that data and add it to the Galactic Standings json data.

Originally posted by @irongut in https://github.com/irongut/EliteALD/issues/192#issuecomment-826489294

Expected Behaviour

Add CyclesSinceTurmoil int property to PowerStanding model and any code required for the backend to StandingsService.

Additional Context

Will require changes to the backend Azure Function and the API json.

Linked To

irongut/EDlib Issue 192 Powerplay History
irongut/EDlib Issue 310 Add Cycles Since Turmoil to Power Details

Add GalNet News

Port GalNet news from EliteALD / XF40Demo.

  • Change service to a singleton that caches & returns the data.
  • Add a GalNetNews model to contain the list of NewsItems & a LastUpdated property like GalacticStandings?
  • Change the BoWs to json.
  • Allow variable number of articles cached & returned.
  • Add unit tests.

Requires:

  • Models/NewsItem.cs
  • Models/Topic.cs
  • Models/TopicsList.cs
  • Resources/NewsBoW.csv
  • Resources/NewsFalseBoW.csv
  • Services/GalNetService.cs
  • Cache (for DownloadService) #2
  • DownloadService #4

Add DownloadService

Move DownloadService over from EliteALD.

Requires:

  • Cache #2
  • Network Connectivity #2
  • APIException
  • NoNetworkNoCacheException

Add Interfaces for platform specific code in Services

Services currently implemented in EliteALD require some decoupling to move them to a cross platform class library. Interfaces that will be implemented in application code are required for platform specific functions:

  • Cache (Standings & network services)
  • Network Connectivity (network services)
  • Settings? (GalNet & network services)

Use constructor injection or an IoC container in services that require these interfaces?

For GalNetService pass the cache time in the GetData() parameters.

For network services remove the WiFi check, the connectivity interface implementation can handle it when required.

Create a Test project

Create a test project. Include tests from XF40Demo to start and expand from there.

Mock Services

The mock services will also be used in expanding the demo project. Including them in EDlib could be useful but also bloat the assembly, use a separate class library?

ICacheService

Tests will require mock implementations of ICacheService. The initial version will return expired for all data keys to force downloads. Later versions can provide mock data.

IConnectivityService

Tests will require a mock implementation of IConnectivityService that is always connected. Another version that is always disconnected could be useful for some test cases.

News BoW Improvement

Add new terms to Bags of Words for GalNet News.

NewsBow

  • Crime: untrustworthy, marooned, prison
  • Economy: discount, sales, board of directors, manufacture
  • Mystery: faint transmission, unexplored, triangulate
  • Politics: galactic summit
  • Science: unexplored, triangulate, encrypt
  • Alliance: lakon, alioth, galactic summit
  • Empire: galactic summit
  • Federation: core dynamics, galactic summit

NewsFalseBoW

  • Federation: pilots federation

Update readme & docs

Bug Report

Installation method is out of date in Readme & docs. Update with instructions for using the Nuget from GitHub Releases. Instructions for nuget.org can be added later.

Add documentation at namespace level including a description of the purpose of the namespace with links to any relevant external documentation. See StackOverflow.

Additional Context

All manually generated sections of the docs & readme should be updated.

Include a mention of debugging with Source Link, etc.

Linked To

#68 Add links to API docs
#73 Improve debugging experience

Improve GalNet article classification

Feature Request

Scraping the GalNet Archive Wiki has shown some gaps in the BoWs for older articles.

BoW:

  • Aliens: unknown-artefact, unknown artefact
  • Combat: melee masters arena competition, firing range, agitators
  • Crime: prohibition, concealed, onionhead
  • Culture: replace festival with festiv, revellers, colonia citizens network, racing, racers, tourism hotspots, base-jump, historic, remembrance week, libations, celebrations, regatta, memorial, kessel run, entertainment, clauss incorporated, cultural
  • Economy: ultratech expo, herculean machines, supratech, galactic mechanics union, consortium, anti-competitive, price fixing, pricing strategy, terraforming, land-enrichment, insurance, macrosphere, commercially, zorgon peterson, faulcon delacy, achilles corporation
  • Exploration: replace explorers with explorer, expedition, solar storms, black hole, universal cartography, colonia, jaques station
  • Health: plague, cure
  • Mystery: unknown-artefact, unknown artefact, thargoid sensor, technical issues, technical problems, mystifying, intermittent problems, fragmentary signal, degraded, highliner antares, intriguing message, formidine rift, unidentified, unusual designation
  • Science: ultratech expo, expedition, terraforming, solar storms, black hole, mycologist, geysers

False Bow:

  • Aliens: expansion list
  • Combat: expansion list, racing, racers, jaques station
  • Crime: expansion list, starport status update, thargoid, cerberus plague
  • Economy: powers update, racing, racers, cerberus plague
  • Exploration: racing, racers
  • Mystery: racing, racers
  • Politics: entertainment, jaques station
  • Science: starport status update, racing, racers
  • Alliance: expansion list, starport status update, racing, racers
  • Empire: expansion list, racing, racers
  • Federation: expansion list, racing, racers

Linked To

0 hours till next cycle not useful

Bug Report

When the time remaining till the next cycle is x days 0 hours it doesn't tell the user a lot.

zero-hours-issue

Expected Behavior

  • Modify CycleService.TimeRemaining() to always return days, hours and minutes.

Additional Context

Linked To

irongut/EliteALD#359 0 hours till next cycle not very useful

GalacticStandings.ToString() doesn't include Turmoil

GalacticStandings.ToString() doesn't include any mention of Turmoil. This is required because it is used by the Standings backend in the email report.

See irongut/EliteALD Issue 146.

GalacticStandings.ToString() uses PowerStanding.ToString() to produce the output.

Add a unique identifier to GalNet articles

Feature Request

To combine different GalNet feeds we need a unique identifier for each article that will be the same for every feed; see irongut/EliteALD#24. To enable this add an identifier to NewsArticle that is a hash of the Title and PublishDate fields.

Expected Behaviour

On get, the new field will check a backing field and return its value if present. If the backing field is empty it will calculate a hash of the Title and PublishDate fields, store it in the backing field and return it.

Add a creator that sets the value or use a setter?

Additional Context

Required for EliteALD v2.0.

Linked To

irongut/EliteALD#24 Add a searchable GalNet News Archive

Rework News & CG classification

Feature Request

The Bags of Words (BoWs) provided for GalNet article & CG classification often need updates. Apps may not want to wait for a library update, may prefer different topics or a different news bias.

Expected Behaviour

Allow calling code to provide alternative BoWs as an optional json string.

Additional Context

Linked To

#11 Add INARA & Community Goals api

JsonSerializationException: Unable to find a constructor for GalacticStandings

Newtonsoft.Json.JsonSerializationException: Unable to find a constructor to use for type EDlib.Standings.GalacticStandings. A class should either have a default constructor, one constructor with arguments or a constructor marked with the JsonConstructor attribute. Path 'Cycle', line 1, position 9.

AppCenter Issue: #1984528607

Stack Trace

Newtonsoft.Json.Serialization    JsonSerializerInternalReader.CreateNewObject (Newtonsoft.Json.JsonReader reader, Newtonsoft.Json.Serialization.JsonObjectContract objectContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, Newtonsoft.Json.Serialization.JsonProperty containerProperty, System.String id, System.Boolean& createdFromNonDefaultCreator)
Newtonsoft.Json.Serialization    JsonSerializerInternalReader.CreateObject (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue)
Newtonsoft.Json.Serialization    JsonSerializerInternalReader.CreateValueInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType, Newtonsoft.Json.Serialization.JsonContract contract, Newtonsoft.Json.Serialization.JsonProperty member, Newtonsoft.Json.Serialization.JsonContainerContract containerContract, Newtonsoft.Json.Serialization.JsonProperty containerMember, System.Object existingValue)
Newtonsoft.Json.Serialization    JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent)
Newtonsoft.Json    JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType)
Newtonsoft.Json    JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType)
Newtonsoft.Json    JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings)
Newtonsoft.Json    JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonSerializerSettings settings)
Newtonsoft.Json    JsonConvert.DeserializeObject[T] (System.String value)
EliteALD.Services    StandingsService.GetData (System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)
EliteALD.ViewModels    StandingsViewModel.GetStandingsAsync (System.Boolean ignoreCache)

Describe the bug
Only affects Release builds.

Improve Unit Tests

Feature Request

Most of the unit tests are really integration tests and depend on downloaded data, as a result they don't fully test the code. Use Moq to remove dependencies on other classes & improve test coverage.

Expected Behaviour

Only tests on network layer should download anything. Use httpbin.org for network layer tests.

Additional Context

Linked To

Create a CD pipeline

CD Pipeline

The CD pipeline will include the same steps as the CI pipeline but it will then include steps to deploy releases to GitHub and Nuget org.

Expected Behaviour

  • Run on PR merge / manual only
  • Use git tags & MinVer to set version number.
  • Add user secrets for tests & demo.
  • Build in Release mode.
  • Run Tests, with coverlet test coverage.
  • Create test coverage summary with a shields.io badge.
  • Upload coverage report as a build artifact.
  • Upload coverage summary to same artifact as report.
  • Upload nugets as a build artifact.
  • Run Demo console app.
  • Create Release Notes. (check Marketplace for an Action)
  • Post test coverage summary to the Release Notes.
  • If PR labelled GitHub-Release publish to GitHub Releases.
  • If PR labelled GitHub-Pre publish to GitHub Releases with pre-release flag set.
  • If PR labelled Nuget-Release publish to Nuget.
  • If PR labelled Build-Docs build docs & publish to GitHub Pages.

.github/workflows/cdbuild.yml

Originally posted by @irongut in #32 (comment)

Additional Context

DocFx

Action to build docfx site

Action to publish site to Github Pages

Linked To

#27 Create EDlib Nuget
#32 Move Build Pipeline to GitHub
#35 .Net 5 Compatibility
#73 Improve debugging experience
irongut/EliteALD#305 Create Build Pipeline
irongut/CodeCoverageSummary

Standings broken with some Arabic calendars

Bug Report

Galactic Standings does not work with Arabic, Saudi Arabia (ar_sa) calendar.

CycleService.CurrentCycle()
System.FormatException: String was not recognized as a valid DateTime.

App Center Issue 4242207755

Stack Trace

System    DateTimeParse.Parse (System.ReadOnlySpan`1[T] s, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles styles)
System    DateTime.Parse (System.String s)
EDlib.Powerplay    CycleService.CurrentCycle ()
EDlib.Powerplay    StandingsService.GetData (System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)
EliteALD.ViewModels    StandingsViewModel.GetStandingsAsync (System.Boolean ignoreCache)

To Reproduce

Steps to reproduce the behavior:

  1. Set calendar to Arabic, Saudi Arabia (ar_sa).
  2. Run app.
  3. Open Galactic Standings.

Expected Behavior

Galactic Standings parses & displays correctly.

Additional Context

Priorities, server status, BGS tick & CGs have no date issues but year is 42.

Arabic (ar_ar) & Arabic, United Arab Emirates (ar_ua) do not have these issues. Other Arabic calendars should be tested.

Firebase Screenshots

Linked To

#51 Errors with non-Western calendars
#64 GalNet broken with some Arabic calendars
irongut/EliteALD Issue 304 GalNet & Standings broken with some Arabic calendars

CGs / INARA API not link safe

Bug Report

On Release builds with linking, the INARA API returns an error when getting Community Goals:

400 - No eventName provided.

To Reproduce

Steps to reproduce the behavior:

  1. Run a release build of an app.
  2. Open a screen that displays CGs.
  3. See error

Expected Behavior

A list of CGs.

Additional Context

Fix required for next EliteALD release.

Linked To

#60 Galactic Standings is not link safe

Add ability to set custom headers for a single network request

Feature Request

The ability to set custom request headers for a single network request that would not be used in future requests would be useful for EliteALD.

Expected Behaviour

  • Add property for a list of custom headers to DownloadOptions
  • Update CachedDownloadService.GetData to use HttpRequestMessage to set any custom headers for each request
  • Update CachedDownloadService.PostData to use HttpRequestMessage to set any custom headers for each request
  • Update DownloadService.GetData to use HttpRequestMessage to set any custom headers for each request
  • Update DownloadService.PostData to use HttpRequestMessage to set any custom headers for each request

Additional Context

See SO for how to use HttpRequestMessage.

Linked To

irongut/EliteALD#428 Cycle Priorities shows wrong data intermittently

Restrict GitHub token permissions

Feature Request

Several workflows do not have GitHub token permissions specified because they use Actions not in the StepSecurity database.

  • Auto Assign
  • Release Build
  • Update Docs

Expected Behaviour

All workflows should restrict the GitHub token permissions.

Additional Context

StepSecurity App

  • Auto Assign: samspills/assign-pr-to-author is not in the KB
  • Release Build: nikeee/docfx-action is not in the KB & run used to push Nuget
  • Update Docs: nikeee/docfx-action is not in the KB

Linked To

#156 Implement StepSecurity Secure Workflows (audit)
#157 Implement StepSecurity Secure Workflows (policy)

CommunityGoalsService.GetDataByTime() Collection enumeration may not execute

Bug Report

CommunityGoalsService.GetDataByTime()
System.InvalidOperationException: Collection was modified; enumeration operation may not execute.

App Center Issue: 897051552

Stack Trace

System.Collections.Generic    List`1+Enumerator[T].MoveNextRare()
System.Collections.Generic    List`1+Enumerator[T].MoveNext()
EDlib.INARA    CommunityGoalsService.GetDataByTime(System.Int32 requestDays, System.Int32 cacheMinutes, EDlib.INARA.InaraIdentity identity, System.Threading.CancellationTokenSource cancelToken, System.String BoW, System.Boolean ignoreCache)
EliteALD.ViewModels    NewsViewModel.GetCommunityGoalsAsync (System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)

To Reproduce

Unknown.

Additional Context

Only 1 error report from 1 user and it did not crash their device:

Property Value
Timestamp 5 Jun 2021, 12:35 PM
Version v1.11.1 (45)
Build RELEASE
Device Galaxy A20
OS Android 10
Language English
Country N/A
Network N/A
Error Message Collection was modified; enumeration operation may not execute.
NetworkAccess.Internet True
ConnectionProfile.WiFi True
WifiOnly False

Linked To

irongut/EliteALD#369 NewsViewModel.UpdateExpiries() Collection enumeration may not execute
irongut/EliteALD#370 CommunityGoalsService.GetDataByTime() Collection enumeration may not execute

Errors with non-Western calendars

Bug Report

EliteALD error reports include several exceptions related to dates from devices using Thai language settings. Exceptions have been seen from several services including Priorities, EDSM & Standings.

DateTime.Parse(System.String s)
ArgumentNullException: Value cannot be null. Parameter name: s

AppCenter #3972984053
AppCenter #2803695455

DateTimeFormatInfo.set_Calendar(System.Globalization.Calendar value)
ArgumentOutOfRangeException: Not a valid calendar for the given culture. Parameter name: value

AppCenter #1582563134
AppCenter #3618643846

Stack Trace

DateTime.Parse (System.String s)
EdsmService.GetData (System.String method, System.Collections.Generic.Dictionary`2[TKey,TValue] parameters, System.String dataKey, System.String lastUpdatedKey, System.TimeSpan expiry, System.Boolean ignoreCache)
EliteStatusService.GetData (System.Boolean ignoreCache)
MenuViewModel.GetEliteStatusAsync (System.Boolean ignoreCache)
DateTimeFormatInfo.set_Calendar (System.Globalization.Calendar value)
System.Globalization.DateTimeFormatInfo..ctor (System.Globalization.CultureData cultureData, System.Globalization.Calendar cal) [0x00022] in <9ec1698a2c964b1abc090676996703e7>:0
CultureInfo.get_DateTimeFormat ()
CultureInfo.GetFormat (System.Type formatType)
DateTimeFormatInfo.get_CurrentInfo ()
DateTimeFormatInfo.GetInstance (System.IFormatProvider provider)
DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.IFormatProvider provider, System.TimeSpan offset)
DateTimeFormat.Format (System.DateTime dateTime, System.String format, System.IFormatProvider provider)
DateTime.ToString ()
DownloadService.GetData (System.String url, System.String dataKey, System.String lastUpdatedKey, System.TimeSpan expiry, System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)
StandingsService.GetData (System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)
StandingsViewModel.GetStandingsAsync (System.Boolean ignoreCache)

To Reproduce

Parse a DateTime from a string.
Convert a DateTime to a string using string.Format() or equivalent code.

Additional Context

Similar reports have been seen in the past for devices with Arabic language settings.
Will require fixing in irongut/EliteALD as well as EDlib.

Linked To

irongut/EliteALD Issue 286 Errors with non-Western calendars.

Improve Release Notes

Feature Request

The current Action for generating release notes nblagoev/pull-release-notes-action does not work as expected, it creates html instead of markdown. Look for another Action on the Marketplace or create a new one.

Expected Behaviour

Action will list all commit messages with author between two commits, in markdown format.

Additional Context

Ideal Features:

  • Output markdown to action output & file
  • Lists commits between a base commit (not included) and head commit (included)
  • Output all commits or only PRs
  • Include commit message & author
  • Include a link to PRs

Linked To

#76 Create a CD pipeline
GitHub API - Compare commits
https://github.com/nblagoev/pull-release-notes-action/blob/f2ccb8e7976e86655c98d5e77b655b31b005dc05/dist/index.js#L11880

Add INARA & Community Goals api

Feature Request

Port INARA & Community Goals api from EliteALD. Allow new services in EDlib or consuming code to add new INARA api methods.

  • Add a PostData method to IDownloadService & implementations.
  • Change InaraService to use IDownloadService instead of it's own HttpClient.
  • Add InaraIdentity class to encapsulate identity & api keys for Inara API. This must be provided by calling app.
  • Change CG service to a singleton that caches & returns the data like other EDlib API Services.
  • Allow variable cache for CGs; min 60 minutes.
  • Change the BoW to json.
  • Allow variable number of days back to return goals returned but cache all the data; min 7 days.
  • Allow calling code to provide alternative BoWs as an optional json string. See #56 Rework News & CG classification.
  • Add methods to CG service to get all (usually 15) or a specific number of CGs.
  • Implement UnitTests using appsettings.json & user secrets to store credentials locally but not in git. CI builds use an Action that replaces values in appsettings.json with values from GitHub Secrets. Use EliteALD credentials.
  • Add latest two CGs to Demo app output. Use appsettings.json, user secrets & GitHub Secrets to provide credentials like tests.
  • Implement Inara getCommanderProfile API, see below.
  • Implement tests for getCommanderProfile API.
  • Add getCommanderProfile API to Demo app. too likely to be throttled
  • Preserve attributes for linker.
  • CI Build: Copy secrets to appsettings.json in Demo app.
  • Ensure all INARA classes are tested.
  • Documentation, documentation, documentation.

Requires

  • Models/CommunityGoal.cs
  • Models/InaraEvent.cs
  • Models/InaraHeader.cs
  • Models/InaraInputOutput.cs renamed to InaraRequest
  • Models/InaraIdentity.cs (new)
  • Models/Topic.cs
  • Resources/CGBoW.csv converted to CGBoW.json
  • Services/CommunityGoalsService.cs
  • Services/InaraService.cs
  • IDownloadService

Linked To

#14 Make the library linker safe
#56 Rework News & CG classification
#60 Galactic Standings is not link safe
irongut/EliteALD#154 Complete transfer of code to EDlib

Reduce GalNet api minimum cache time

Feature Request

The GalNet api minimum cache time is set to 3 hours because that was the backend update frequency. The backend has now been updated to an hourly schedule (during approximate UK office hours) so the cache minimum can be reduced to 1 hour.

Expected Behaviour

Minimum cache time for GalNet = 1 hour

Linked To

irongut/EliteALD#334 Increase GalNet Backend update frequency

Add PowerDetailsService

Move PowerDetailsService + required models over from EliteALD. Change embedded csv data to json.

Requires:

  • Models/PowerComms.cs
  • Models/PowerDetails.cs
  • PowerDetails.csv
  • Cache #2
  • DownloadService #4

Add EDSM & Elite Status api

Port GalNet EDSM & Elite Status api from EliteALD. Add more EDSM api methods.
Allow new services consuming code to add new EDSM api methods.

Elite Status

Docs

  • Change service to a singleton that caches & returns the data.
  • Allow variable cache time.
  • Documentation.

Requires:

  • Models/EliteStatus.cs
  • Services/EDSMService.cs
  • Services/EliteStatusService.cs
  • Cache (for DownloadService) #2
  • DownloadService #4

GalNet broken with some Arabic calendars

Bug Report

GalNet News does not work with Arabic, Saudi Arabia (ar_sa) calendar.

NewsArticleConverter.SetProperty (Newtonsoft.Json.JsonReader reader, EDlib.GalNet.NewsArticle item)
System.FormatException: String was not recognized as a valid DateTime.

App Center Issue 1550929719

Stack Trace

System    DateTimeParse.Parse (System.ReadOnlySpan`1[T] s, System.Globalization.DateTimeFormatInfo dtfi, System.Globalization.DateTimeStyles styles)
System    DateTime.Parse (System.String s, System.IFormatProvider provider)
System    Convert.ToDateTime (System.String value, System.IFormatProvider provider)
System.String.System    IConvertible.ToDateTime (System.IFormatProvider provider)
System    Convert.ToDateTime (System.Object value)
EDlib.GalNet    NewsArticleConverter.SetProperty (Newtonsoft.Json.JsonReader reader, EDlib.GalNet.NewsArticle item)
EDlib.GalNet    NewsArticleConverter.ReadJson (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Object existingValue, Newtonsoft.Json.JsonSerializer serializer)
Newtonsoft.Json.Serialization    JsonSerializerInternalReader.DeserializeConvertable (Newtonsoft.Json.JsonConverter converter, Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Object existingValue)
Newtonsoft.Json.Serialization    JsonSerializerInternalReader.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType, System.Boolean checkAdditionalContent)
Newtonsoft.Json    JsonSerializer.DeserializeInternal (Newtonsoft.Json.JsonReader reader, System.Type objectType)
Newtonsoft.Json    JsonSerializer.Deserialize (Newtonsoft.Json.JsonReader reader, System.Type objectType)
Newtonsoft.Json    JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonSerializerSettings settings)
Newtonsoft.Json    JsonConvert.DeserializeObject (System.String value, System.Type type, Newtonsoft.Json.JsonConverter[] converters)
Newtonsoft.Json    JsonConvert.DeserializeObject[T] (System.String value, Newtonsoft.Json.JsonConverter[] converters)
EDlib.GalNet    GalNetService+<>c__DisplayClass8_0.<GetData>b__0 ()
System.Threading.Tasks    Task.InnerInvoke ()
System.Threading.Tasks    Task.Execute ()
EDlib.GalNet    GalNetService.GetData (System.Int32 articleCount, System.Int32 expiryHours, System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)
EDlib.GalNet    GalNetService.GetData (System.Int32 expiryHours, System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)
EliteALD.ViewModels    NewsViewModel.GetGalNetNewsAsync (System.Threading.CancellationTokenSource cancelToken, System.Boolean ignoreCache)

To Reproduce

Steps to reproduce the behavior:

  1. Set calendar to Arabic, Saudi Arabia (ar_sa).
  2. Run app.
  3. Open GalNet.

Expected Behavior

GalNet parses & displays correctly.

Additional Context

Priorities, server status, BGS tick & CGs have no date issues but year is 42.

Arabic (ar_ar) & Arabic, United Arab Emirates (ar_ua) do not have these issues. Other Arabic calendars should be tested.

Firebase Screenshots

Linked To

#51 Errors with non-Western calendars
#63 Standings broken with some Arabic calendars
irongut/EliteALD Issue 304 GalNet & Standings broken with some Arabic calendars

Improve CycleService

Feature Request

CycleService.CycleImminent() currently returns true in the last 12 hours of a cycle. Allow consuming code to specify when the cycle is imminent in hours, 1 - 24 with a default of 12.

Expected Behaviour

CycleService.CycleImminent() will return true if the end of the current cycle is within the specified number of hours.

Additional Context

CycleService.FinalDay() can then call CycleImminent() with a value of 24 hours.

Linked To

Decouple StandingsService from CachedDownloadService

Feature Request

StandingsService is too closely coupled to CachedDownloadService and the cache implementation due to the way expiry is handled. It has its own CachedDownloadService.GetData() overload that includes dataKey & updatedKey parameters.

A better solution that allows the use of any IDownloadService implementation should be found.

Originally posted by @irongut in #34 (comment)

Linked To

irongut/EliteALD#154 Complete transfer of code to EDlib

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.