Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
c493fda
New Setup after class
met4lk1tty Nov 5, 2025
6339165
Prevent NullPointerException by initializing messageToSend with empty…
met4lk1tty Nov 5, 2025
7fb92bf
Add TextField for sending messages
met4lk1tty Nov 5, 2025
9f42de1
New branch commit
met4lk1tty Nov 12, 2025
ee282bc
first commit on fixOldVersion
met4lk1tty Nov 13, 2025
7c3c55f
Add error handling to network and UI layers
met4lk1tty Nov 13, 2025
91eec52
updated recieve method
met4lk1tty Nov 13, 2025
de73c88
File attachment
met4lk1tty Nov 13, 2025
c1f8a98
file attachment pt 2
met4lk1tty Nov 13, 2025
3a9ae4b
update recieve method
met4lk1tty Nov 13, 2025
6335070
File working
met4lk1tty Nov 13, 2025
82c8532
time
met4lk1tty Nov 13, 2025
e590c73
update code with raw message and date
met4lk1tty Nov 13, 2025
b26c5df
add icons
met4lk1tty Nov 13, 2025
1a24158
FILE WORKING
met4lk1tty Nov 14, 2025
b5d314a
file udpate with save
met4lk1tty Nov 14, 2025
18f28d8
matrix background
met4lk1tty Nov 14, 2025
e2558cf
File saving works
met4lk1tty Nov 14, 2025
3931c2e
Matrix falling
met4lk1tty Nov 14, 2025
a6bb555
automatisk sparning
met4lk1tty Nov 14, 2025
4217c6f
automatic
met4lk1tty Nov 14, 2025
a141882
saving to downloads
met4lk1tty Nov 14, 2025
5cefb29
deleted unessecary method
met4lk1tty Nov 14, 2025
1c93451
improved file handlement
met4lk1tty Nov 14, 2025
3fef7c6
small improvements
met4lk1tty Nov 14, 2025
1fd57e7
removed file from url
met4lk1tty Nov 14, 2025
2f41422
random commit
met4lk1tty Nov 14, 2025
3345609
Add raw Json message recievement in terminal
met4lk1tty Nov 14, 2025
8baec6d
Image icon and image pop up
met4lk1tty Nov 14, 2025
cd91c96
Filter no message when recieving raw json message to not appear in ch…
met4lk1tty Nov 14, 2025
beae9fb
Tests
met4lk1tty Nov 15, 2025
2de1a9b
test 2
met4lk1tty Nov 15, 2025
63d7972
test 3
met4lk1tty Nov 15, 2025
cf4b429
updated matrix binary chat design
met4lk1tty Nov 15, 2025
bbc3dbc
random commit because i dont remember if i did any changes lol
met4lk1tty Nov 15, 2025
94baca9
Fixed incoming vs you messages to be displayed
met4lk1tty Nov 15, 2025
397844a
Fixed welcome message
met4lk1tty Nov 15, 2025
c6cf7dd
Delete debug message
met4lk1tty Nov 15, 2025
ca17434
Track ID's Incoming and You
met4lk1tty Nov 15, 2025
2d07a09
Fix ntfyDto with param comments and deleted equals and hashcode
met4lk1tty Nov 15, 2025
8751797
Hasmaps to keep track of incoming and you messages
met4lk1tty Nov 15, 2025
7dfca3c
Param comments
met4lk1tty Nov 15, 2025
9ad6190
Param comments in hellomodel class
met4lk1tty Nov 15, 2025
f0d6359
comment commit
met4lk1tty Nov 15, 2025
61f4652
testclasses updated
met4lk1tty Nov 15, 2025
2bc0ee1
Tests
met4lk1tty Nov 15, 2025
7066cb0
fix styles.css
met4lk1tty Nov 15, 2025
84303a1
Final commit
met4lk1tty Nov 15, 2025
8b698a3
Cleanup
met4lk1tty Nov 15, 2025
6f86c1f
finished
met4lk1tty Nov 15, 2025
1ea4a9d
Push
met4lk1tty Nov 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NTFY_BASE_URL=https://ntfy.fungover.org
NTFY_TOPIC=mytopic
Comment on lines +1 to +2
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Consider using .env.example instead of committing .env.

Committing the .env file with hardcoded values can lead to issues:

  • The generic topic name "mytopic" could cause message collision if multiple developers/instances use the same configuration
  • .env files typically contain environment-specific or sensitive configuration and should be in .gitignore

Recommendation:

  1. Rename this file to .env.example with placeholder values
  2. Add .env to .gitignore
  3. Update documentation to instruct users to copy .env.example to .env and customize the NTFY_TOPIC value
-NTFY_BASE_URL=https://ntfy.fungover.org
-NTFY_TOPIC=mytopic
+NTFY_BASE_URL=https://ntfy.fungover.org
+NTFY_TOPIC=your-unique-topic-name-here

Also, add a blank line at the end of the file as indicated by the linter.

Committable suggestion skipped: line range outside the PR's diff.

🧰 Tools
🪛 dotenv-linter (4.0.0)

[warning] 2-2: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

🤖 Prompt for AI Agents
In .env around lines 1 to 2, the repository currently commits concrete
environment values (NTFY_BASE_URL and NTFY_TOPIC) which should not be checked
in; rename this file to .env.example and replace the values with non-sensitive
placeholders (e.g. NTFY_BASE_URL=https://your-ntfy.example and
NTFY_TOPIC=your-topic) so developers can copy it, add .env to .gitignore to
prevent committing private configs, update project docs/README to instruct
contributors to copy .env.example -> .env and set a unique NTFY_TOPIC, and
ensure the resulting .env.example file ends with a blank newline.

43 changes: 40 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<groupId>com.example</groupId>
<artifactId>javafx</artifactId>
<artifactId>javafx-chat</artifactId>
<version>1.0-SNAPSHOT</version>

<properties>
Expand All @@ -16,6 +17,7 @@
<mockito.version>5.20.0</mockito.version>
<javafx.version>25</javafx.version>
</properties>

<dependencies>
<dependency>
<groupId>org.junit.jupiter</groupId>
Expand All @@ -35,6 +37,7 @@
<version>${mockito.version}</version>
<scope>test</scope>
</dependency>

<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-controls</artifactId>
Expand All @@ -45,7 +48,41 @@
<artifactId>javafx-fxml</artifactId>
<version>${javafx.version}</version>
</dependency>
<dependency>
<groupId>org.openjfx</groupId>
<artifactId>javafx-swing</artifactId>
<version>${javafx.version}</version>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.17.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.17.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.17.2</version>
</dependency>
Comment on lines +57 to +71
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

Verify Jackson version for security and currency.

Ensure that Jackson 2.17.2 is the latest stable version and is free from known security vulnerabilities.


🌐 Web query:

What is the latest version of Jackson databind and are there any known security vulnerabilities in version 2.17.2?

💡 Result:

Short answer

  • Latest Jackson as of Nov 15, 2025: Jackson 3.0.0 (GA Oct 3, 2025); the newest 2.x line is 2.20.0 (Aug 28, 2025). [1][2]

About jackson-databind 2.17.2

  • 2.17.2 was released July 5, 2024. [3]
  • There is no widely-published CVE that names "2.17.2" specifically, but jackson-databind has a long history of deserialization-related CVEs (examples: CVE-2017-7525 and other later issues affecting various 2.x ranges). Some vulnerabilities affect older 2.x releases or specific subranges; others were fixed in later 2.13–2.19/2.20 and 3.0 patches. Check NVD/CVE entries for any CVEs that list the exact affected-version ranges relevant to your use. [4][5]

Recommendation

  • If you can, upgrade to a supported patched release (2.20.x or 3.0.x) or the latest patch for your chosen major line, and follow Jackson security guidance (disable polymorphic default typing unless needed, restrict allowed types, apply vendor patches). [1][2][3]

Sources

  • Jackson 3.0 release notes (FasterXML/GitHub). [1]
  • Jackson 2.20 release notes (FasterXML/GitHub). [2]
  • Jackson 2.17.2 release notes (FasterXML/GitHub). [3]
  • NVD / CVE examples for jackson-databind deserialization vulnerabilities. [4][5]

Upgrade Jackson dependencies to latest supported version.

Jackson 2.17.2 was released July 5, 2024, and is significantly outdated. The latest 2.x line is 2.20.0 (Aug 28, 2025), and 3.0.0 is the latest overall (GA Oct 3, 2025). While no specific CVE names 2.17.2, jackson-databind has a long history of deserialization-related vulnerabilities across various 2.x ranges, with fixes applied in later 2.13–2.20 and 3.0 patches.

Update all three Jackson dependencies in pom.xml (lines 57–71) to 2.20.0 or 3.0.0 to ensure you receive security patches and stay within a supported release.

🤖 Prompt for AI Agents
In pom.xml around lines 57 to 71, the jackson-databind, jackson-core, and
jackson-annotations dependencies are pinned to 2.17.2 — update all three
dependency <version> entries to a supported release (prefer 2.20.0 if you want
to stay on the 2.x line or 3.0.0 if you’re ready for the 3.x upgrade), keep
versions consistent across all Jackson modules, then run a full build and test
pass to catch any compatibility breaks; if choosing 3.x, scan code for API
changes and adjust imports/config usage as needed before committing.

<dependency>
<groupId>io.github.cdimascio</groupId>
<artifactId>dotenv-java</artifactId>
<version>3.2.0</version>
</dependency>

<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>4.0.0-beta.15</version>
<scope>test</scope>
</dependency>
Comment on lines +78 to +83
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

❓ Verification inconclusive

Replace WireMock beta with stable release.

WireMock currently has two releases available: the 3.x release and the new 4.x beta releases. Using a beta version (4.0.0-beta.15) in production or even for tests introduces unnecessary stability risk. Downgrade to the stable 3.13.1 (latest, published June 11, 2025).

Apply this diff:

        <dependency>
            <groupId>org.wiremock</groupId>
            <artifactId>wiremock</artifactId>
-           <version>4.0.0-beta.15</version>
+           <version>3.13.1</version>
            <scope>test</scope>
        </dependency>

I'll verify the WireMock release information to validate the review comment.

Downgrade WireMock to stable version 3.13.1.

WireMock 3.13.1 is the latest version, last published June 11, 2025. The 4.x release of WireMock is currently in beta and under active development. Version 3.x of WireMock is entering maintenance mode as the team focuses on the first non-beta release of WireMock version 4. For a test dependency, using the stable 3.13.1 release is the appropriate choice.

        <dependency>
            <groupId>org.wiremock</groupId>
            <artifactId>wiremock</artifactId>
-           <version>4.0.0-beta.15</version>
+           <version>3.13.1</version>
            <scope>test</scope>
        </dependency>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>4.0.0-beta.15</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.wiremock</groupId>
<artifactId>wiremock</artifactId>
<version>3.13.1</version>
<scope>test</scope>
</dependency>
🤖 Prompt for AI Agents
In pom.xml around lines 78 to 83, the WireMock test dependency uses a 4.x beta
version; replace it with the stable 3.13.1 release to avoid using a beta for
tests. Update the <version> element for the org.wiremock:wiremock dependency
from 4.0.0-beta.15 to 3.13.1 and run mvn -U test (or your build) to ensure the
test suite resolves the downgraded artifact.

</dependencies>

<build>
<plugins>
<plugin>
Expand All @@ -55,7 +92,7 @@
<configuration>
<mainClass>com.example.HelloFX</mainClass>
<options>
<option>--enable-native-access=javafx.graphics</option>
<option>--enable-native-access=javafx.graphics</option>
</options>
<launcher>javafx</launcher>
<stripDebug>true</stripDebug>
Expand Down
107 changes: 107 additions & 0 deletions src/main/java/com/example/FakeNtfyConnection.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
package com.example;

import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.function.Consumer;

/**
* A fake implementation of {@link NtfyConnection} for testing purposes.
* Stores sent messages and files in memory and simulates incoming messages.
*/
public class FakeNtfyConnection implements NtfyConnection {

private final List<String> sentMessages = new ArrayList<>();
private final List<File> sentFiles = new ArrayList<>();
private Consumer<NtfyMessageDto> messageHandler;
private boolean shouldSucceed = true;

/**
* Sends a text message.
* Stores the message in memory and returns success based on {@link #shouldSucceed}.
*
* @param message the message to send
* @return true if operation succeeds, false otherwise
*/
@Override
public boolean send(String message) {
sentMessages.add(Objects.requireNonNull(message));
return shouldSucceed;
}

/**
* Sends a file.
* Stores the file in memory if it exists and returns success based on {@link #shouldSucceed}.
*
* @param file the file to send
* @return true if file exists and operation succeeds, false otherwise
*/
@Override
public boolean sendFile(File file) {
if (file != null && file.exists()) {
sentFiles.add(file);
return shouldSucceed;
}
return false;
}

/**
* Registers a message handler to receive incoming messages.
* Only the last registered handler will be active.
*
* @param handler the consumer that handles incoming messages
*/
@Override
public void receive(Consumer<NtfyMessageDto> handler) {
this.messageHandler = Objects.requireNonNull(handler);
}

/**
* Simulates an incoming message.
* Calls the registered handler if present.
*
* @param message the message to simulate
*/
public void simulateIncomingMessage(NtfyMessageDto message) {
if (messageHandler != null) {
messageHandler.accept(message);
}
}

/**
* Returns a copy of all sent messages for verification.
*
* @return list of sent messages
*/
public List<String> getSentMessages() {
return new ArrayList<>(sentMessages);
}

/**
* Returns a copy of all sent files for verification.
*
* @return list of sent files
*/
public List<File> getSentFiles() {
return new ArrayList<>(sentFiles);
}

/**
* Configures whether operations should succeed.
*
* @param shouldSucceed true for success, false for failure
*/
public void setShouldSucceed(boolean shouldSucceed) {
this.shouldSucceed = shouldSucceed;
}

/**
* Clears all stored messages, files, and the message handler.
*/
public void clear() {
sentMessages.clear();
sentFiles.clear();
messageHandler = null;
}
}
Loading
Loading